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 2828 Literal ,
2929 TypeVar ,
3030 Union ,
31+ cast ,
3132 overload ,
3233)
3334
@@ -396,21 +397,13 @@ async def setup():
396397def _get_event_loop_fixture_id_for_async_fixture (
397398 request : FixtureRequest , func : Any
398399) -> 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+ )
400403 loop_scope = (
401404 getattr (func , "_loop_scope" , None ) or default_loop_scope or request .scope
402405 )
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"
414407
415408
416409def _create_task_in_context (
You can’t perform that action at this time.
0 commit comments