From 368fa2c03e5be3eb00cfea45e168886d9a24a286 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 9 Jan 2024 23:31:35 +0200 Subject: [PATCH] fixtures: remove unhelpful FixtureManager.{FixtureLookupError,FixtureLookupErrorRepr} Couldn't find any reason for this indirection, nor any plugins which rely on it. Seems like historically it was done to avoid some imports... --- src/_pytest/fixtures.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 1c94583e8..13c1790be 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -525,7 +525,7 @@ class FixtureRequest(abc.ABC): :param msg: An optional custom error message. """ - raise self._fixturemanager.FixtureLookupError(None, self, msg) + raise FixtureLookupError(None, self, msg) def getfixturevalue(self, argname: str) -> Any: """Dynamically run a named fixture function. @@ -1438,9 +1438,6 @@ class FixtureManager: by a lookup of their FuncFixtureInfo. """ - FixtureLookupError = FixtureLookupError - FixtureLookupErrorRepr = FixtureLookupErrorRepr - def __init__(self, session: "Session") -> None: self.session = session self.config: Config = session.config