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