Description: Pytest 9 compat
Author: Thomas Goirand <zigo@debian.org>
Bug-Debian: https://bugs.debian.org/1123461
Forwarded: no
Last-Update: 2025-12-26

--- python-wrapt-1.17.3.orig/tests/conftest.py
+++ python-wrapt-1.17.3/tests/conftest.py
@@ -1,4 +1,5 @@
 import sys
+from pathlib import Path
 
 try:
     from pytest import File as FileCollector
@@ -11,35 +12,36 @@ class DummyCollector(FileCollector):
     def collect(self):
         return []
 
-def construct_dummy(path, parent):
+def construct_dummy(path: Path, parent):
     if hasattr(DummyCollector, "from_parent"):
-        item = DummyCollector.from_parent(parent, fspath=path)
+        item = DummyCollector.from_parent(parent, path=path)
         return item
     else:
         return DummyCollector(path, parent=parent)
 
-def pytest_pycollect_makemodule(path, parent):
-    if '_py33' in path.basename and version < (3, 3):
+def pytest_pycollect_makemodule(module_path: Path, parent):
+    name = module_path.name
+    if '_py33' in name and version < (3, 3):
         return construct_dummy(path, parent)
-    if '_py34' in path.basename and version < (3, 4):
+    if '_py34' in name and version < (3, 4):
         return construct_dummy(path, parent)
-    if '_py35' in path.basename and version < (3, 5):
+    if '_py35' in name and version < (3, 5):
         return construct_dummy(path, parent)
-    if '_py36' in path.basename and version < (3, 6):
+    if '_py36' in name and version < (3, 6):
         return construct_dummy(path, parent)
-    if '_py37' in path.basename and version < (3, 7):
+    if '_py37' in name and version < (3, 7):
         return construct_dummy(path, parent)
-    if '_py38' in path.basename and version < (3, 8):
+    if '_py38' in name and version < (3, 8):
         return construct_dummy(path, parent)
-    if '_py39' in path.basename and version < (3, 9):
+    if '_py39' in name and version < (3, 9):
         return construct_dummy(path, parent)
-    if '_py310' in path.basename and version < (3, 10):
+    if '_py310' in name and version < (3, 10):
         return construct_dummy(path, parent)
-    if '_py311' in path.basename and version < (3, 11):
+    if '_py311' in name and version < (3, 11):
         return construct_dummy(path, parent)
-    if '_py312' in path.basename and version < (3, 12):
+    if '_py312' in name and version < (3, 12):
         return construct_dummy(path, parent)
-    if '_py3' in path.basename and version < (3, 0):
+    if '_py3' in name and version < (3, 0):
         return construct_dummy(path, parent)
-    if '_py2' in path.basename and version >= (3, 0):
+    if '_py2' in name and version >= (3, 0):
         return construct_dummy(path, parent)
