Skip to content

Commit fe12dcb

Browse files
committed
[refactor] Use Pytester for one of the Hypothesis tests.
Signed-off-by: Michael Seifert <[email protected]>
1 parent 7a589a7 commit fe12dcb

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

tests/hypothesis/test_base.py

+16-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,22 @@
88
from pytest import Pytester
99

1010

11-
@given(st.integers())
12-
@pytest.mark.asyncio
13-
async def test_mark_inner(n):
14-
assert isinstance(n, int)
11+
def test_hypothesis_given_decorator_before_asyncio_mark(pytester: Pytester):
12+
pytester.makepyfile(
13+
dedent(
14+
"""\
15+
import pytest
16+
from hypothesis import given, strategies as st
17+
18+
@given(st.integers())
19+
@pytest.mark.asyncio
20+
async def test_mark_inner(n):
21+
assert isinstance(n, int)
22+
"""
23+
)
24+
)
25+
result = pytester.runpytest("--asyncio-mode=strict", "-W default")
26+
result.assert_outcomes(passed=1)
1527

1628

1729
@pytest.mark.asyncio

0 commit comments

Comments
 (0)