fixtures: simplify a bit of code

This commit is contained in:
Ran Benita 2024-03-08 23:24:38 +02:00
parent f5de111357
commit ff551b7685
1 changed files with 1 additions and 3 deletions

View File

@ -1061,9 +1061,7 @@ class FixtureDef(Generic[FixtureValue]):
# with their finalization. # with their finalization.
for argname in self.argnames: for argname in self.argnames:
fixturedef = request._get_active_fixturedef(argname) fixturedef = request._get_active_fixturedef(argname)
if argname != "request": if not isinstance(fixturedef, PseudoFixtureDef):
# PseudoFixtureDef is only for "request".
assert isinstance(fixturedef, FixtureDef)
fixturedef.addfinalizer(functools.partial(self.finish, request=request)) fixturedef.addfinalizer(functools.partial(self.finish, request=request))
my_cache_key = self.cache_key(request) my_cache_key = self.cache_key(request)