@@ -252,14 +252,12 @@ def _preprocess_async_fixtures(
252
252
or fixturedef .scope
253
253
)
254
254
if scope == "function" :
255
- event_loop_fixture_name = "function"
256
255
event_loop_fixture_id : Optional [str ] = "event_loop"
257
256
else :
258
257
try :
259
258
event_loop_node = _retrieve_scope_root (collector , scope )
260
259
except Exception :
261
260
continue
262
- event_loop_fixture_name = event_loop_node .name
263
261
event_loop_fixture_id = event_loop_node .stash .get (
264
262
# Type ignored because of non-optimal mypy inference.
265
263
_event_loop_fixture_id , # type: ignore[arg-type]
@@ -288,29 +286,26 @@ def _preprocess_async_fixtures(
288
286
fixturedef .argnames += ("event_loop" ,)
289
287
_synchronize_async_fixture (
290
288
fixturedef ,
291
- event_loop_fixture_name ,
292
289
event_loop_fixture_id ,
293
290
)
294
291
assert _is_asyncio_fixture_function (fixturedef .func )
295
292
processed_fixturedefs .add ((fixturedef , event_loop_fixture_id ))
296
293
297
294
298
295
def _synchronize_async_fixture (
299
- fixturedef : FixtureDef , event_loop_fixture_name : str , event_loop_fixture_id : str
296
+ fixturedef : FixtureDef , event_loop_fixture_id : str
300
297
) -> None :
301
298
"""
302
299
Wraps the fixture function of an async fixture in a synchronous function.
303
300
"""
304
301
if inspect .isasyncgenfunction (fixturedef .func ) or getattr (
305
302
fixturedef .func , "_async_fixture" , False
306
303
):
307
- _wrap_asyncgen_fixture (
308
- fixturedef , event_loop_fixture_name , event_loop_fixture_id
309
- )
304
+ _wrap_asyncgen_fixture (fixturedef , event_loop_fixture_id )
310
305
elif inspect .iscoroutinefunction (fixturedef .func ) or getattr (
311
306
fixturedef .func , "_async_fixture" , False
312
307
):
313
- _wrap_async_fixture (fixturedef , event_loop_fixture_name , event_loop_fixture_id )
308
+ _wrap_async_fixture (fixturedef , event_loop_fixture_id )
314
309
315
310
316
311
def _add_kwargs (
@@ -347,9 +342,7 @@ def _perhaps_rebind_fixture_func(
347
342
return func
348
343
349
344
350
- def _wrap_asyncgen_fixture (
351
- fixturedef : FixtureDef , event_loop_fixture_name : str , event_loop_fixture_id : str
352
- ) -> None :
345
+ def _wrap_asyncgen_fixture (fixturedef : FixtureDef , event_loop_fixture_id : str ) -> None :
353
346
fixture = fixturedef .func
354
347
355
348
if getattr (fixture , "_async_fixture" , False ):
@@ -405,9 +398,7 @@ async def async_finalizer() -> None:
405
398
fixturedef .func = _asyncgen_fixture_wrapper
406
399
407
400
408
- def _wrap_async_fixture (
409
- fixturedef : FixtureDef , event_loop_fixture_name : str , event_loop_fixture_id : str
410
- ) -> None :
401
+ def _wrap_async_fixture (fixturedef : FixtureDef , event_loop_fixture_id : str ) -> None :
411
402
fixture = fixturedef .func
412
403
413
404
if getattr (fixture , "_async_fixture" , False ):
0 commit comments