Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/_pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def __init__(
self,
pyfuncitem: Function,
fixturename: str | None,
arg2fixturedefs: dict[str, Sequence[FixtureDef[Any]]],
arg2fixturedefs: Mapping[str, Sequence[FixtureDef[Any]]],
fixture_defs: dict[str, FixtureDef[Any]],
*,
_ispytest: bool = False,
Expand All @@ -372,10 +372,9 @@ def __init__(
#: Fixture for which this request is being performed.
self.fixturename: Final = fixturename
self._pyfuncitem: Final = pyfuncitem
# The FixtureDefs for each fixture name requested by this item.
# Starts from the statically-known fixturedefs resolved during
# collection. Dynamically requested fixtures (using
# `request.getfixturevalue("foo")`) are added dynamically.
# The FixtureDefs for each fixture name statically requested by this
# item (computed during collection). Dynamically requested fixtures
# (using `request.getfixturevalue("foo")`) are not included here.
self._arg2fixturedefs: Final = arg2fixturedefs
# The evaluated argnames so far, mapping to the FixtureDef they resolved
# to.
Expand Down Expand Up @@ -564,8 +563,6 @@ def _get_active_fixturedef(self, argname: str) -> FixtureDef[object]:
# getfixturevalue(argname) which was naturally
# not known at parsing/collection time.
fixturedefs = self._fixturemanager.getfixturedefs(argname, self._pyfuncitem)
if fixturedefs is not None:
self._arg2fixturedefs[argname] = fixturedefs
# No fixtures defined with this name.
if fixturedefs is None:
raise FixtureLookupError(argname, self)
Expand Down Expand Up @@ -669,7 +666,7 @@ def __init__(self, pyfuncitem: Function, *, _ispytest: bool = False) -> None:
super().__init__(
fixturename=None,
pyfuncitem=pyfuncitem,
arg2fixturedefs=pyfuncitem._fixtureinfo.name2fixturedefs.copy(),
arg2fixturedefs=pyfuncitem._fixtureinfo.name2fixturedefs,
fixture_defs={},
_ispytest=_ispytest,
)
Expand Down
Loading