Skip to content

Commit

Permalink
reduce bad-report blast radius
Browse files Browse the repository at this point in the history
This will now make the offending test fail; previously it'd take down the whole process.
  • Loading branch information
Zac-HD committed Jul 22, 2024
1 parent 3a791fb commit d89a6fd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions hypothesis-python/src/_hypothesis_pytestplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def note_statistics(stats):
with current_pytest_item.with_value(item):
yield
if store.results:
item.hypothesis_report_information = list(store.results)
item.hypothesis_report_information = "\n".join(store.results)

def _stash_get(config, key, default):
if hasattr(config, "stash"):
Expand All @@ -325,9 +325,7 @@ def _stash_get(config, key, default):
def pytest_runtest_makereport(item, call):
report = (yield).get_result()
if hasattr(item, "hypothesis_report_information"):
report.sections.append(
("Hypothesis", "\n".join(item.hypothesis_report_information))
)
report.sections.append(("Hypothesis", item.hypothesis_report_information))
if report.when != "teardown":
return

Expand Down

0 comments on commit d89a6fd

Please sign in to comment.