Skip to content

Commit 1639c81

Browse files
committed
Check notes in assertion helper
1 parent 59e001b commit 1639c81

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

hypothesis-python/tests/common/utils.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,14 @@ def assert_falsifying_output(
178178
if expected_exception is None:
179179
# Some tests want to check the output of non-failing runs.
180180
test()
181+
msg = ""
181182
else:
182-
with raises(expected_exception):
183+
with raises(expected_exception) as exc_info:
183184
test()
185+
notes = "\n".join(getattr(exc_info.value, "__notes__", []))
186+
msg = str(exc_info.value) + "\n" + notes
184187

185-
output = out.getvalue()
188+
output = out.getvalue() + msg
186189
assert f"{example_type} example:" in output
187190
assert_output_contains_failure(output, test, **kwargs)
188191

0 commit comments

Comments
 (0)