We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4b403b9 + 74824aa commit 26f45a5Copy full SHA for 26f45a5
changelog.d/+pytest_collection_path.changed.md
@@ -0,0 +1 @@
1
+Switch a pytest hook from path to collection_path.
test/unit/conftest.py
@@ -64,13 +64,12 @@ def pytest_report_header(config):
64
65
66
@pytest.hookimpl(tryfirst=True)
67
-def pytest_ignore_collect(path, config):
+def pytest_ignore_collect(collection_path, config):
68
"""Ignore all tests from subfolders for different apiver."""
69
- path = str(path)
70
ver = config.getoption('--api')
71
other_versions = [v for v in API_VERSIONS if v != ver]
72
for other_version in other_versions:
73
- if other_version + os.sep in path:
+ if other_version in collection_path.parts:
74
return True
75
return False
76
0 commit comments