fixtures: simplify FixtureRequest._get_fixturestack()
This commit is contained in:
parent
73c4105230
commit
6c575ad8c8
|
@ -607,14 +607,11 @@ class FixtureRequest:
|
||||||
def _get_fixturestack(self) -> List["FixtureDef[Any]"]:
|
def _get_fixturestack(self) -> List["FixtureDef[Any]"]:
|
||||||
current = self
|
current = self
|
||||||
values: List[FixtureDef[Any]] = []
|
values: List[FixtureDef[Any]] = []
|
||||||
while 1:
|
while isinstance(current, SubRequest):
|
||||||
fixturedef = getattr(current, "_fixturedef", None)
|
values.append(current._fixturedef) # type: ignore[has-type]
|
||||||
if fixturedef is None:
|
|
||||||
values.reverse()
|
|
||||||
return values
|
|
||||||
values.append(fixturedef)
|
|
||||||
assert isinstance(current, SubRequest)
|
|
||||||
current = current._parent_request
|
current = current._parent_request
|
||||||
|
values.reverse()
|
||||||
|
return values
|
||||||
|
|
||||||
def _compute_fixture_value(self, fixturedef: "FixtureDef[object]") -> None:
|
def _compute_fixture_value(self, fixturedef: "FixtureDef[object]") -> None:
|
||||||
"""Create a SubRequest based on "self" and call the execute method
|
"""Create a SubRequest based on "self" and call the execute method
|
||||||
|
|
Loading…
Reference in New Issue