Skip to content

Commit dd4e982

Browse files
committed
refactor: Addressed warning about missing default fixture loop scope in Hypothesis tests.
1 parent 7a8586a commit dd4e982

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/hypothesis/test_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111

1212
def test_hypothesis_given_decorator_before_asyncio_mark(pytester: Pytester):
13+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
1314
pytester.makepyfile(
1415
dedent(
1516
"""\
@@ -42,6 +43,7 @@ async def test_mark_and_parametrize(x, y):
4243

4344

4445
def test_can_use_explicit_event_loop_fixture(pytester: Pytester):
46+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = module")
4547
pytester.makepyfile(
4648
dedent(
4749
"""\
@@ -78,6 +80,7 @@ async def test_explicit_fixture_request(event_loop, n):
7880

7981

8082
def test_async_auto_marked(pytester: Pytester):
83+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
8184
pytester.makepyfile(
8285
dedent(
8386
"""\
@@ -100,6 +103,7 @@ async def test_hypothesis(n: int):
100103

101104
def test_sync_not_auto_marked(pytester: Pytester):
102105
"""Assert that synchronous Hypothesis functions are not marked with asyncio"""
106+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
103107
pytester.makepyfile(
104108
dedent(
105109
"""\

0 commit comments

Comments
 (0)