File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change 28
28
Literal ,
29
29
TypeVar ,
30
30
Union ,
31
+ cast ,
31
32
overload ,
32
33
)
33
34
@@ -396,21 +397,13 @@ async def setup():
396
397
def _get_event_loop_fixture_id_for_async_fixture (
397
398
request : FixtureRequest , func : Any
398
399
) -> str :
399
- default_loop_scope = request .config .getini ("asyncio_default_fixture_loop_scope" )
400
+ default_loop_scope = cast (
401
+ _ScopeName , request .config .getini ("asyncio_default_fixture_loop_scope" )
402
+ )
400
403
loop_scope = (
401
404
getattr (func , "_loop_scope" , None ) or default_loop_scope or request .scope
402
405
)
403
- if loop_scope == "function" :
404
- event_loop_fixture_id = "_function_event_loop"
405
- else :
406
- event_loop_node = _retrieve_scope_root (request ._pyfuncitem , loop_scope )
407
- event_loop_fixture_id = event_loop_node .stash .get (
408
- # Type ignored because of non-optimal mypy inference.
409
- _event_loop_fixture_id , # type: ignore[arg-type]
410
- "" ,
411
- )
412
- assert event_loop_fixture_id
413
- return event_loop_fixture_id
406
+ return f"_{ loop_scope } _event_loop"
414
407
415
408
416
409
def _create_task_in_context (
You can’t perform that action at this time.
0 commit comments