Skip to content

Commit

Permalink
Adopt reviewer suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
mkavulich committed Apr 19, 2024
1 parent 55972ff commit 0c65498
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions test_prebuild/test_track_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,12 @@ def test_successful_match(capsys):
streams = capsys.readouterr()
expected_output_list = expected_output.splitlines()
streams_err_list = streams.err.splitlines()
# Split into lines to ignore whitespace differences
i = 0
for line in streams_err_list:
assert streams_err_list[i].strip() == expected_output_list[i].strip()
i+=1
for (err, expected) in zip(streams_err_list, expected_output_list):
assert err.strip() == expected.strip()

def test_successful_match_with_subcycles(capsys):
"""Tests whether test_track_variables.py produces expected output from sample suite and
metadata files for a case with a successful match(user provided a variable that exists
metadata files for a case with a successful match (user provided a variable that exists
within the schemes specified by the test suite). In this case, the test suite file
contains subcycles, so the output should reflect this."""

Expand All @@ -70,11 +67,8 @@ def test_successful_match_with_subcycles(capsys):
streams = capsys.readouterr()
expected_output_list = expected_output.splitlines()
streams_err_list = streams.err.splitlines()
# Split into lines to ignore whitespace differences
i = 0
for line in streams_err_list:
assert streams_err_list[i].strip() == expected_output_list[i].strip()
i+=1
for (err, expected) in zip(streams_err_list, expected_output_list):
assert err.strip() == expected.strip()


def test_partial_match(capsys):
Expand Down Expand Up @@ -102,11 +96,8 @@ def test_partial_match(capsys):
streams = capsys.readouterr()
expected_output_list = expected_output.splitlines()
streams_err_list = streams.err.splitlines()
# Split into lines to ignore whitespace differences
i = 0
for line in streams_err_list:
assert streams_err_list[i].strip() == expected_output_list[i].strip()
i+=1
for (err, expected) in zip(streams_err_list, expected_output_list):
assert err.strip() == expected.strip()


def test_no_match(capsys):
Expand All @@ -121,11 +112,8 @@ def test_no_match(capsys):
streams = capsys.readouterr()
expected_output_list = expected_output.splitlines()
streams_err_list = streams.err.splitlines()
# Split into lines to ignore whitespace differences
i = 0
for line in streams_err_list:
assert streams_err_list[i].strip() == expected_output_list[i].strip()
i+=1
for (err, expected) in zip(streams_err_list, expected_output_list):
assert err.strip() == expected.strip()


def test_bad_config(capsys):
Expand Down

0 comments on commit 0c65498

Please sign in to comment.