File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,6 +128,29 @@ async def test_asyncio_marker_without_loop(self, remove_loop):
128128 assert ret == 'ok'
129129
130130
131+ class TestEventLoopStartedBeforeFixtures :
132+ @pytest .fixture
133+ async def loop (self ):
134+ return asyncio .get_event_loop ()
135+
136+ @staticmethod
137+ def foo ():
138+ return 1
139+
140+ @pytest .mark .asyncio
141+ async def test_no_event_loop (self , loop ):
142+ assert await loop .run_in_executor (None , self .foo ) == 1
143+
144+ @pytest .mark .asyncio
145+ async def test_event_loop_after_fixture (self , loop , event_loop ):
146+ assert await loop .run_in_executor (None , self .foo ) == 1
147+
148+ @pytest .mark .asyncio
149+ async def test_event_loop_before_fixture (self , event_loop , loop ):
150+ assert await loop .run_in_executor (None , self .foo ) == 1
151+
152+
153+
131154@pytest .mark .asyncio
132155async def test_no_warning_on_skip ():
133156 pytest .skip ("Test a skip error inside asyncio" )
You can’t perform that action at this time.
0 commit comments