tests: Upgrade our hook implementation for pytest 7
https://docs.pytest.org/en/7.4.x/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path https://docs.pytest.org/en/7.4.x/reference/reference.html#std-hook-pytest_ignore_collect 8.0.0 removes the "path" compatibility alias we used.
This commit is contained in:
parent
1ad6b68d33
commit
4b11776f76
|
|
@ -184,11 +184,10 @@ def pytest_collection_modifyitems(config, items):
|
|||
items[:] = remaining_items
|
||||
|
||||
|
||||
def pytest_ignore_collect(path):
|
||||
def pytest_ignore_collect(collection_path: pathlib.Path) -> bool:
|
||||
"""Ignore BDD tests if we're unable to run them."""
|
||||
fspath = pathlib.Path(path)
|
||||
skip_bdd = hasattr(sys, 'frozen')
|
||||
rel_path = fspath.relative_to(pathlib.Path(__file__).parent)
|
||||
rel_path = collection_path.relative_to(pathlib.Path(__file__).parent)
|
||||
return rel_path == pathlib.Path('end2end') / 'features' and skip_bdd
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue