Skip to content

Commit c967d50

Browse files
authored
Merge pull request #12037 from bluetech/fixtures-getnextfixturedef-parent
fixtures: remove unneeded optimization from `_getnextfixturedef`
2 parents 98b008f + 686f9e0 commit c967d50

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/_pytest/fixtures.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,7 @@ def _getnextfixturedef(self, argname: str) -> "FixtureDef[Any]":
413413
# We arrive here because of a dynamic call to
414414
# getfixturevalue(argname) usage which was naturally
415415
# not known at parsing/collection time.
416-
parent = self._pyfuncitem.parent
417-
assert parent is not None
418-
fixturedefs = self._fixturemanager.getfixturedefs(argname, parent)
416+
fixturedefs = self._fixturemanager.getfixturedefs(argname, self._pyfuncitem)
419417
if fixturedefs is not None:
420418
self._arg2fixturedefs[argname] = fixturedefs
421419
# No fixtures defined with this name.

0 commit comments

Comments
 (0)