Skip to content

Commit 68a2da0

Browse files
committed
refactor: Addressed warnings about missing default fixture loop scope in tests/test_explicit_event_loop_fixture_request.py.
1 parent a5853d0 commit 68a2da0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_explicit_event_loop_fixture_request.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
def test_emit_warning_when_event_loop_is_explicitly_requested_in_coroutine(
77
pytester: Pytester,
88
):
9+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
910
pytester.makepyfile(
1011
dedent(
1112
"""\
@@ -27,6 +28,7 @@ async def test_coroutine_emits_warning(event_loop):
2728
def test_emit_warning_when_event_loop_is_explicitly_requested_in_coroutine_method(
2829
pytester: Pytester,
2930
):
31+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
3032
pytester.makepyfile(
3133
dedent(
3234
"""\
@@ -49,6 +51,7 @@ async def test_coroutine_emits_warning(self, event_loop):
4951
def test_emit_warning_when_event_loop_is_explicitly_requested_in_coroutine_staticmethod(
5052
pytester: Pytester,
5153
):
54+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
5255
pytester.makepyfile(
5356
dedent(
5457
"""\
@@ -72,6 +75,7 @@ async def test_coroutine_emits_warning(event_loop):
7275
def test_emit_warning_when_event_loop_is_explicitly_requested_in_coroutine_fixture(
7376
pytester: Pytester,
7477
):
78+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
7579
pytester.makepyfile(
7680
dedent(
7781
"""\
@@ -98,6 +102,7 @@ async def test_uses_fixture(emits_warning):
98102
def test_emit_warning_when_event_loop_is_explicitly_requested_in_async_gen_fixture(
99103
pytester: Pytester,
100104
):
105+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
101106
pytester.makepyfile(
102107
dedent(
103108
"""\
@@ -124,6 +129,7 @@ async def test_uses_fixture(emits_warning):
124129
def test_does_not_emit_warning_when_event_loop_is_explicitly_requested_in_sync_function(
125130
pytester: Pytester,
126131
):
132+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
127133
pytester.makepyfile(
128134
dedent(
129135
"""\
@@ -141,6 +147,7 @@ def test_uses_fixture(event_loop):
141147
def test_does_not_emit_warning_when_event_loop_is_explicitly_requested_in_sync_fixture(
142148
pytester: Pytester,
143149
):
150+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
144151
pytester.makepyfile(
145152
dedent(
146153
"""\

0 commit comments

Comments
 (0)