Skip to content

Commit 9bdbec5

Browse files
committed
refactor: simplify ini check
Do it the other way around, check if the file suffix is ini rather than listing the possible names.
1 parent 6eab536 commit 9bdbec5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_pytest/config/findpaths.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def locate_config(
117117
ini_config = load_config_dict_from_file(p)
118118
if ini_config is not None:
119119
should_warn = False
120-
if p.name in ["pytest.ini", ".pytest.ini"]:
120+
if ".ini" in p.suffixes:
121121
pyproject = base / "pyproject.toml"
122122
if pyproject.is_file():
123123
should_warn = (

0 commit comments

Comments
 (0)