Skip to content

Commit 874c4a2

Browse files
committed
try fix tests again
1 parent bea5da1 commit 874c4a2

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

hypothesis-python/src/hypothesis/extra/dateutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import datetime as dt
2323

24-
from dateutil import tz, zoneinfo
24+
from dateutil import tz, zoneinfo # type: ignore
2525

2626
from hypothesis import strategies as st
2727
from hypothesis.strategies._internal.utils import cacheable, defines_strategy

hypothesis-python/tests/conjecture/test_inquisitor.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717

1818
def fails_with_output(expected, error=AssertionError, **kw):
19+
expected = [expected] if isinstance(expected, str) else expected
20+
1921
def _inner(f):
2022
def _new():
2123
with pytest.raises(error) as err:
2224
settings(print_blob=False, derandomize=True, **kw)(f)()
2325
got = "\n".join(err.value.__notes__).strip() + "\n"
24-
assert got == expected.strip() + "\n"
26+
assert any(got == s.strip() + "\n" for s in expected)
2527

2628
return _new
2729

@@ -32,7 +34,8 @@ def _new():
3234
# false negatives in our inquisitor code skip over it sometimes, depending on the
3335
# seen_passed_buffers. yet another thing that should be improved by moving to the ir.
3436
@fails_with_output(
35-
"""
37+
[
38+
"""
3639
Falsifying example: test_inquisitor_comments_basic_fail_if_either(
3740
# The test always failed when commented parts were varied together.
3841
a=False,
@@ -41,7 +44,18 @@ def _new():
4144
d=True,
4245
e=False, # or any other generated value
4346
)
44-
"""
47+
""",
48+
"""
49+
Falsifying example: test_inquisitor_comments_basic_fail_if_either(
50+
# The test always failed when commented parts were varied together.
51+
a=False, # or any other generated value
52+
b=True,
53+
c=[], # or any other generated value
54+
d=True,
55+
e=False, # or any other generated value
56+
)
57+
""",
58+
]
4559
)
4660
@given(st.booleans(), st.booleans(), st.lists(st.none()), st.booleans(), st.booleans())
4761
def test_inquisitor_comments_basic_fail_if_either(a, b, c, d, e):

0 commit comments

Comments
 (0)