From 4b11776f76a7f8a02bef9fb1644752da51928bc1 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 10 Jan 2024 14:41:39 +0100 Subject: 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. --- tests/conftest.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9d7c5c29c..ddacc3db1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 -- cgit v1.2.3-54-g00ecf