summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2024-01-10 14:41:39 +0100
committerFlorian Bruhin <me@the-compiler.org>2024-01-10 14:41:39 +0100
commit4b11776f76a7f8a02bef9fb1644752da51928bc1 (patch)
tree1a7b62cefe0baa535b34b5f6c27ec289719b5d15
parent1ad6b68d33faecc236e26cc4df6d86f13d812b9b (diff)
downloadqutebrowser-4b11776f76a7f8a02bef9fb1644752da51928bc1.tar.gz
qutebrowser-4b11776f76a7f8a02bef9fb1644752da51928bc1.zip
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.
-rw-r--r--tests/conftest.py5
1 files 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