Closed
Description
Since version 6.54.0, hypothesis uses exception notes (PEP 678) to show falsifying examples underneath the raised exception. With python < 3.11, this is done using a custom exception hook provided by exceptiongroup, a backport of PEP 654. The problem is that trio also uses a custom excepthook to manage multi-errors. In practice, this leads to the falsifying example not being displayed depending on the import order. Even worse, simply having pytest-trio
installed causes the falsifying examples to disappear. Consider the following test:
from hypothesis import given
from hypothesis import strategies as st
@given(x=st.integers())
def test_notes(x):
1/x
Without pytest-trio
installed you would get:
@given(x=st.integers())
def test_notes(x):
> 1/x
E ZeroDivisionError: division by zero
E Falsifying example: test_notes(
E x=0,
E )
test_notes.py:7: ZeroDivisionError
And with pytest-trio
installed:
@given(x=st.integers())
def test_notes(x):
> 1/x
E ZeroDivisionError: division by zero
test_notes.py:7: ZeroDivisionError
Metadata
Metadata
Assignees
Labels
No labels