Skip to content

Commit f3e05e1

Browse files
committed
Check large outputs line by line to account for order changes
1 parent ebcaa52 commit f3e05e1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_commands.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def test_report(sample_iocs, capsys):
4040
def normalize_whitespace(s: str) -> str:
4141
return "\n".join(" ".join(line.split()) for line in s.strip().splitlines())
4242

43-
assert normalize_whitespace(expected_output) == normalize_whitespace(captured.out)
43+
for line in expected_output.strip().splitlines():
44+
assert normalize_whitespace(line) in normalize_whitespace(captured.out)
4445

4546

4647
@pytest.mark.parametrize(
@@ -176,7 +177,9 @@ def test_status(sample_iocs, capsys):
176177
def normalize_whitespace(s: str) -> str:
177178
return "\n".join(" ".join(line.split()) for line in s.strip().splitlines())
178179

179-
assert normalize_whitespace(expected_output) == normalize_whitespace(captured.out)
180+
for line in expected_output.strip().splitlines():
181+
assert normalize_whitespace(line) in normalize_whitespace(captured.out)
182+
180183
assert rc == 0
181184

182185

0 commit comments

Comments
 (0)