From 2c80de532f6501090ccd08a71dbc504af51f3991 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 10 Jul 2023 01:20:01 +0300 Subject: [PATCH] fixtures: replace a `startswith("conftest.py")` with `== "conftest.py"` I can't imagine why we would want to test for a prefix here. --- 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 319c2a595..04c4c85d3 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1471,7 +1471,7 @@ class FixtureManager: # Construct the base nodeid which is later used to check # what fixtures are visible for particular tests (as denoted # by their test id). - if p.name.startswith("conftest.py"): + if p.name == "conftest.py": try: nodeid = str(p.parent.relative_to(self.config.rootpath)) except ValueError: