Skip to content

Commit fb84061

Browse files
committed
hypothesis/strategies/_internal/core.py:1821
1 parent b7441b5 commit fb84061

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

hypothesis-python/tests/cover/test_composite.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,19 +196,22 @@ def test_drawfn_cannot_be_instantiated():
196196

197197

198198
@pytest.mark.skipif(sys.version_info[:2] == (3, 9), reason="stack depth varies???")
199-
@pytest.mark.skipif(sys.version_info[:2] <= (3, 11), reason="TEMP: see PR #3961")
200199
def test_warns_on_strategy_annotation():
201200
# TODO: print the stack on Python 3.10 and 3.11 to determine the appropriate
202201
# stack depth to use. Consider adding a debug-print if IN_COVERAGE_TESTS
203202
# and the relevant depth is_hypothesis_file(), for easier future fixing.
203+
#
204+
# Meanwhile, the test is not skipped on 3.10/3.11 as it is still required for
205+
# coverage of the warning-generating branch.
204206
with pytest.warns(HypothesisWarning, match="Return-type annotation") as w:
205207

206208
@st.composite
207209
def my_integers(draw: st.DrawFn) -> st.SearchStrategy[int]:
208210
return draw(st.integers())
209211

210-
assert len(w.list) == 1
211-
assert w.list[0].filename == __file__ # check stacklevel points to user code
212+
if sys.version_info[:2] > (3, 11): # TEMP: see PR #3961
213+
assert len(w.list) == 1
214+
assert w.list[0].filename == __file__ # check stacklevel points to user code
212215

213216

214217
def test_composite_allows_overload_without_draw():

0 commit comments

Comments
 (0)