python3Packages.overrides: fix pytest9 compat

This commit is contained in:
Martin Weinelt
2026-02-01 17:40:57 +01:00
parent 8f7b8369d0
commit dc5914413c
2 changed files with 23 additions and 7 deletions
@@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
pytestCheckHook,
setuptools,
}:
@@ -19,15 +18,13 @@ buildPythonPackage rec {
hash = "sha256-gQDw5/RpAFNYWFOuxIAArPkCOoBYWUnsDtv1FEFteHo=";
};
nativeBuildInputs = [ setuptools ];
# https://github.com/mkorpela/overrides/pull/136
patches = [ ./pytest9-compat.patch ];
build-system = [ setuptools ];
nativeCheckInputs = [ pytestCheckHook ];
disabledTests = lib.optionals (pythonAtLeast "3.12") [
# KeyError: 'assertRaises'
"test_enforcing_when_incompatible"
];
pythonImportsCheck = [ "overrides" ];
meta = {
@@ -0,0 +1,19 @@
diff --git a/conftest.py b/conftest.py
index a00ac4e..51f37fe 100644
--- a/conftest.py
+++ b/conftest.py
@@ -1,11 +1,10 @@
import sys
+from pathlib import Path
from typing import Optional
-import py
-
-def pytest_ignore_collect(path: py.path.local, config: "Config") -> Optional[bool]:
+def pytest_ignore_collect(collection_path: Path) -> Optional[bool]:
if sys.version_info[0] == 3 and sys.version_info[1] < 8:
- if str(path).endswith("__py38.py"):
+ if str(collection_path.name).endswith("__py38.py"):
return True
return None