File: pytest-9.0.patch

package info (click to toggle)
python-overrides 7.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 260 kB
  • sloc: python: 1,661; sh: 5; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 1,218 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: Martin Weinelt <hexa@darmstadt.ccc.de>
Date: Sun, 25 Jan 2026 00:48:49 +0100
Subject: Fix support for pytest 9.0

The pytest_ignore_collect function has deprecated the path argument in
7.0 becaues it uses the deprecated py library.

Instead it provides a collection_path parameter that uses a pathlib Path
object.

[1] https://docs.pytest.org/en/7.1.x/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path

Origin: other, https://github.com/mkorpela/overrides/pull/136
Bug-Debian: https://bugs.debian.org/1123282
Last-Update: 2026-01-26
---
 conftest.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

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