Skip to content

Commit

Permalink
fixtures: simplify a bit of code
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetech committed Mar 8, 2024
1 parent f5de111 commit ff551b7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/_pytest/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,9 +1061,7 @@ def execute(self, request: SubRequest) -> FixtureValue:
# with their finalization.
for argname in self.argnames:
fixturedef = request._get_active_fixturedef(argname)
if argname != "request":
# PseudoFixtureDef is only for "request".
assert isinstance(fixturedef, FixtureDef)
if not isinstance(fixturedef, PseudoFixtureDef):
fixturedef.addfinalizer(functools.partial(self.finish, request=request))

my_cache_key = self.cache_key(request)
Expand Down

0 comments on commit ff551b7

Please sign in to comment.