File tree 1 file changed +14
-11
lines changed
1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -570,18 +570,21 @@ def _get_active_fixturedef(
570
570
self , argname : str
571
571
) -> Union ["FixtureDef[object]" , PseudoFixtureDef [object ]]:
572
572
fixturedef = self ._fixture_defs .get (argname )
573
- if fixturedef is None :
574
- try :
575
- fixturedef = self ._getnextfixturedef (argname )
576
- except FixtureLookupError :
577
- if argname == "request" :
578
- cached_result = (self , [0 ], None )
579
- return PseudoFixtureDef (cached_result , Scope .Function )
580
- raise
581
- self ._compute_fixture_value (fixturedef )
582
- self ._fixture_defs [argname ] = fixturedef
583
- else :
573
+ if fixturedef is not None :
584
574
self ._check_scope (fixturedef , fixturedef ._scope )
575
+ return fixturedef
576
+
577
+ try :
578
+ fixturedef = self ._getnextfixturedef (argname )
579
+ except FixtureLookupError :
580
+ if argname == "request" :
581
+ cached_result = (self , [0 ], None )
582
+ return PseudoFixtureDef (cached_result , Scope .Function )
583
+ raise
584
+
585
+ self ._compute_fixture_value (fixturedef )
586
+
587
+ self ._fixture_defs [argname ] = fixturedef
585
588
return fixturedef
586
589
587
590
def _get_fixturestack (self ) -> List ["FixtureDef[Any]" ]:
You can’t perform that action at this time.
0 commit comments