nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1From b502a5e2b3048a996ada4c4246aafad99d3dd14c Mon Sep 17 00:00:00 2001
2From: Steve Kowalik <steven@wedontsleep.org>
3Date: Thu, 27 Nov 2025 10:44:40 +1100
4Subject: [PATCH] Support pytest 9 changes
5
6The old py.path arguments to the hook functions have been removed as of
7pytest 9, switch to the shiny new pathlib ones.
8---
9 html5lib/tests/conftest.py | 18 +++++++++---------
10 requirements-test.txt | 2 +-
11 2 files changed, 10 insertions(+), 10 deletions(-)
12
13diff --git a/html5lib/tests/conftest.py b/html5lib/tests/conftest.py
14index fffeb50c..4a97dc21 100644
15--- a/html5lib/tests/conftest.py
16+++ b/html5lib/tests/conftest.py
17@@ -90,22 +90,22 @@ def pytest_configure(config):
18 pytest.exit("\n".join(msgs))
19
20
21-def pytest_collect_file(path, parent):
22- dir = os.path.abspath(path.dirname)
23+def pytest_collect_file(file_path, parent):
24+ dir = file_path.parent
25 dir_and_parents = set()
26 while dir not in dir_and_parents:
27 dir_and_parents.add(dir)
28- dir = os.path.dirname(dir)
29+ dir = dir.parent
30
31 if _tree_construction in dir_and_parents:
32- if path.ext == ".dat":
33- return TreeConstructionFile.from_parent(parent, fspath=path)
34+ if file_path.suffix == ".dat":
35+ return TreeConstructionFile.from_parent(parent, path=file_path)
36 elif _tokenizer in dir_and_parents:
37- if path.ext == ".test":
38- return TokenizerFile.from_parent(parent, fspath=path)
39+ if file_path.suffix == ".test":
40+ return TokenizerFile.from_parent(parent, path=file_path)
41 elif _sanitizer_testdata in dir_and_parents:
42- if path.ext == ".dat":
43- return SanitizerFile.from_parent(parent, fspath=path)
44+ if file_path.suffix == ".dat":
45+ return SanitizerFile.from_parent(parent, path=file_path)
46
47
48 # Tiny wrapper to allow .from_parent constructors on older pytest for PY27