Skip to content

Commit 5df2fb3

Browse files
committed
Update pytest_collect_file for latest pytest
1 parent c17ff77 commit 5df2fb3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
# 3rd party
88
from pytest_mypy_plugins.collect import YamlTestFile, pytest_addoption # noqa: F401
99

10-
def pytest_collect_file(path, parent) -> Optional[YamlTestFile]: # noqa: MAN001
11-
if path.ext == ".yaml" and path.basename.startswith(("test-", "test_")):
12-
return YamlTestFile.from_parent(parent, fspath=path)
10+
def pytest_collect_file(file_path, parent) -> Optional[YamlTestFile]: # noqa: MAN001
11+
if file_path.suffix == ".yaml" and file_path.name.startswith(("test-", "test_")):
12+
return YamlTestFile.from_parent(parent, path=file_path, fspath=None)
1313
return None
1414

1515
except ImportError:

0 commit comments

Comments
 (0)