Skip to content

Commit

Permalink
Update pytest_collect_file for latest pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed May 16, 2024
1 parent c17ff77 commit 5df2fb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# 3rd party
from pytest_mypy_plugins.collect import YamlTestFile, pytest_addoption # noqa: F401

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

except ImportError:
Expand Down

0 comments on commit 5df2fb3

Please sign in to comment.