File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -726,22 +726,11 @@ def __init__(
726726 _ispytest = _ispytest ,
727727 )
728728 self ._parent_request : Final [FixtureRequest ] = request
729- self ._scope_field : Final = scope
730729 self ._fixturedef : Final [FixtureDef [object ]] = fixturedef
731730 if param is not NOTSET :
732731 self .param = param
733732 self .param_index : Final = param_index
734-
735- def __repr__ (self ) -> str :
736- return f"<SubRequest { self .fixturename !r} for { self ._pyfuncitem !r} >"
737-
738- @property
739- def _scope (self ) -> Scope :
740- return self ._scope_field
741-
742- @property
743- def node (self ):
744- scope = self ._scope
733+ self ._scope_field : Final = scope
745734 if scope is Scope .Function :
746735 # This might also be a non-function Item despite its attribute name.
747736 node : nodes .Node | None = self ._pyfuncitem
@@ -755,7 +744,18 @@ def node(self):
755744 assert node , (
756745 f'Could not obtain a node for scope "{ scope } " for function { self ._pyfuncitem !r} '
757746 )
758- return node
747+ self ._node : Final = node
748+
749+ def __repr__ (self ) -> str :
750+ return f"<SubRequest { self .fixturename !r} for { self ._pyfuncitem !r} >"
751+
752+ @property
753+ def _scope (self ) -> Scope :
754+ return self ._scope_field
755+
756+ @property
757+ def node (self ):
758+ return self ._node
759759
760760 def _check_scope (
761761 self ,
You can’t perform that action at this time.
0 commit comments