From 5e02d9c0641bb1de1237095930bc49da0c6f98ba Mon Sep 17 00:00:00 2001 From: Sadra Barikbin Date: Tue, 5 Sep 2023 19:48:40 +0330 Subject: [PATCH] Apply review comment --- src/_pytest/fixtures.py | 4 +++- src/_pytest/python.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 27eb2ef3b..873cb4a25 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1079,6 +1079,8 @@ class IdentityFixture(FixtureDef[FixtureValue]): fixturemanager: "FixtureManager", argname: str, scope: Union[Scope, _ScopeName, Callable[[str, Config], _ScopeName], None], + *, + _ispytest: bool = False, ): super().__init__( fixturemanager, @@ -1087,7 +1089,7 @@ class IdentityFixture(FixtureDef[FixtureValue]): lambda request: request.param, scope, None, - _ispytest=True, + _ispytest=_ispytest, ) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 6465c8434..f019672a3 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1376,7 +1376,10 @@ class Metafunc: fixturedef = name2pseudofixturedef[argname] else: fixturedef = IdentityFixture( - self.definition.session._fixturemanager, argname, scope_ + self.definition.session._fixturemanager, + argname, + scope_, + _ispytest=True, ) if name2pseudofixturedef is not None: name2pseudofixturedef[argname] = fixturedef