Skip to content

Commit

Permalink
only test for stable output
Browse files Browse the repository at this point in the history
  • Loading branch information
youkaichao committed Nov 28, 2023
1 parent c4a67e9 commit 3e738bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_pytorch/cmp_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
if line.strip() and not line.strip().startswith("#"):
expected_lines.append(line.strip())
assert len(output_lines) == len(expected_lines), f"len(output_lines)={len(output_lines)}, len(expected_lines)={len(expected_lines)}"
# sometimes the lines are not in the same order, some lines are switched without changing the behavior of the code.
output_lines.sort()
expected_lines.sort()
for output_line, expected_line in zip(output_lines, expected_lines):
assert output_line == expected_line, f"output_file={output_file}\nexpected_file={expected_file}\noutput_line={output_line}\nexpected_line={expected_line}\n"

0 comments on commit 3e738bf

Please sign in to comment.