File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -546,16 +546,14 @@ def _can_substitute(item: Function) -> bool:
546546
547547 def setup (self ) -> None :
548548 runner_fixture_id = f"_{ self ._loop_scope } _scoped_runner"
549- if runner_fixture_id in self .fixturenames :
550- return super (). setup ( )
551- # The runner must be resolved before async fixtures when loop
552- # factories are configured. Otherwise, the async fixtures see a
553- # stale loop from the previous factory .
549+ if runner_fixture_id not in self .fixturenames :
550+ self . fixturenames . append ( runner_fixture_id )
551+ # When loop factories are configured, resolve the loop factory
552+ # fixture early so that a factory variant change cascades cache
553+ # invalidation before any async fixture checks its cache .
554554 hook_caller = self .config .hook .pytest_asyncio_loop_factories
555555 if hook_caller .get_hookimpls ():
556- self .fixturenames .insert (0 , runner_fixture_id )
557- else :
558- self .fixturenames .append (runner_fixture_id )
556+ _ = self ._request .getfixturevalue (_asyncio_loop_factory .__name__ )
559557 return super ().setup ()
560558
561559 def runtest (self ) -> None :
You can’t perform that action at this time.
0 commit comments