Skip to content

Commit

Permalink
Fix report_single_test for cases with NaNs
Browse files Browse the repository at this point in the history
The function was broken by
AMReX-Codes/amrex#3823. When a variable contains
NaNs, the line used to be "< NaN present >\n", but now it's "< NaN present
>" followed by white spaces and then '\n'. In that case, the line is split
into three fields and we should skip the last field with just white spaces.
  • Loading branch information
WeiqunZhang committed Jun 16, 2024
1 parent 55b5b24 commit 2947a63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def report_single_test(suite, test, tests, failure_msg=None):
line.strip().replace('<', '&lt;').replace('>', '&gt;'))
continue

fields = [q.strip() for q in line.split(" ") if not q == ""]
fields = [q.strip() for q in line.split(" ") if not q.strip() == ""]

if fields:
if fields[0].startswith("variable"):
Expand Down

0 comments on commit 2947a63

Please sign in to comment.