Skip to content

Commit

Permalink
Merge pull request #260 from oleksandr-pavlyk/handle-runs-with-no-war…
Browse files Browse the repository at this point in the history
…nings

Handle runs of sub-tests where no warnings arise
  • Loading branch information
asmeurer committed May 10, 2024
2 parents 82c3ec4 + 5ca1212 commit a9c8e46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def pytest_json_modifyreport(json_report):
# doesn't store a full stack of where it was issued from. The resulting
# warnings will be in order of the first time each warning is issued since
# collections.Counter is ordered just like dict().
counted_warnings = Counter([frozenset(i.items()) for i in json_report['warnings']])
counted_warnings = Counter([frozenset(i.items()) for i in json_report.get('warnings', dict())])
deduped_warnings = [{**dict(i), 'count': counted_warnings[i]} for i in counted_warnings]

json_report['warnings'] = deduped_warnings

0 comments on commit a9c8e46

Please sign in to comment.