From 65c01f531b45bd62c5a28a910645dbfb878d8017 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 1 Sep 2023 14:53:36 +0300 Subject: [PATCH] fixtures: use the item `fixturenames` in `request.fixturenames` `_pyfuncitem.fixturenames` is just an alias for `_pyfuncitem._fixtureinfo.names_closure` (at least in core pytest), so let's do the less abstraction-breaking thing. --- src/_pytest/fixtures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 88ee50adf..0fefaa0d0 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -405,7 +405,7 @@ class FixtureRequest(abc.ABC): @property def fixturenames(self) -> List[str]: """Names of all active fixtures in this request.""" - result = list(self._pyfuncitem._fixtureinfo.names_closure) + result = list(self._pyfuncitem.fixturenames) result.extend(set(self._fixture_defs).difference(result)) return result