diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py
index <HASH>..<HASH> 100644
--- a/src/_pytest/fixtures.py
+++ b/src/_pytest/fixtures.py
@@ -372,6 +372,7 @@ def _fill_fixtures_impl(function: "Function") -> None:
         fi = fm.getfixtureinfo(function.parent, function.obj, None)
         function._fixtureinfo = fi
         request = function._request = FixtureRequest(function, _ispytest=True)
+        fm.session._setupstate.prepare(function)
         request._fillfixtures()
         # Prune out funcargs for jstests.
         newfuncargs = {}
fixtures: make sure to properly setup stack for _fill_fixtures_impl

This code is weird, dead, deprecated and will be removed in pytest 7,
but for now some tests execute it, so fix it up in preparation for
some changes.