6
6
def test_emit_warning_when_event_loop_is_explicitly_requested_in_coroutine (
7
7
pytester : Pytester ,
8
8
):
9
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
9
10
pytester .makepyfile (
10
11
dedent (
11
12
"""\
@@ -27,6 +28,7 @@ async def test_coroutine_emits_warning(event_loop):
27
28
def test_emit_warning_when_event_loop_is_explicitly_requested_in_coroutine_method (
28
29
pytester : Pytester ,
29
30
):
31
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
30
32
pytester .makepyfile (
31
33
dedent (
32
34
"""\
@@ -49,6 +51,7 @@ async def test_coroutine_emits_warning(self, event_loop):
49
51
def test_emit_warning_when_event_loop_is_explicitly_requested_in_coroutine_staticmethod (
50
52
pytester : Pytester ,
51
53
):
54
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
52
55
pytester .makepyfile (
53
56
dedent (
54
57
"""\
@@ -72,6 +75,7 @@ async def test_coroutine_emits_warning(event_loop):
72
75
def test_emit_warning_when_event_loop_is_explicitly_requested_in_coroutine_fixture (
73
76
pytester : Pytester ,
74
77
):
78
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
75
79
pytester .makepyfile (
76
80
dedent (
77
81
"""\
@@ -98,6 +102,7 @@ async def test_uses_fixture(emits_warning):
98
102
def test_emit_warning_when_event_loop_is_explicitly_requested_in_async_gen_fixture (
99
103
pytester : Pytester ,
100
104
):
105
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
101
106
pytester .makepyfile (
102
107
dedent (
103
108
"""\
@@ -124,6 +129,7 @@ async def test_uses_fixture(emits_warning):
124
129
def test_does_not_emit_warning_when_event_loop_is_explicitly_requested_in_sync_function (
125
130
pytester : Pytester ,
126
131
):
132
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
127
133
pytester .makepyfile (
128
134
dedent (
129
135
"""\
@@ -141,6 +147,7 @@ def test_uses_fixture(event_loop):
141
147
def test_does_not_emit_warning_when_event_loop_is_explicitly_requested_in_sync_fixture (
142
148
pytester : Pytester ,
143
149
):
150
+ pytester .makeini ("[pytest]\n asyncio_default_fixture_loop_scope = function" )
144
151
pytester .makepyfile (
145
152
dedent (
146
153
"""\
0 commit comments