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 39 40
|
From: Colin Watson <cjwatson@debian.org>
Date: Sun, 14 Sep 2025 12:42:29 +0100
Subject: Fix compatibility with pytest 8.4
https://github.com/pytest-dev/pytest/pull/12473 removed
`_pytestfixturefunction`. The `getfixturemarker` function is still
private, but has existed across all pytest versions that we support.
Fixes: #33
Bug: https://github.com/bitprophet/pytest-relaxed/issues/33
Bug-Debian: https://bugs.debian.org/1114286
Forwarded: https://github.com/bitprophet/pytest-relaxed/pull/34
Last-Update: 2025-09-14
---
pytest_relaxed/classes.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pytest_relaxed/classes.py b/pytest_relaxed/classes.py
index 9d6b48a..727d99a 100644
--- a/pytest_relaxed/classes.py
+++ b/pytest_relaxed/classes.py
@@ -6,6 +6,7 @@ from pytest import Class, Module
# NOTE: don't see any other way to get access to pytest innards besides using
# the underscored name :(
+from _pytest.fixtures import getfixturemarker
from _pytest.python import PyCollector
@@ -27,8 +28,7 @@ def istestfunction(obj, name):
"teardown",
"teardown_method",
)
- # TODO: is this reliable? how about __pytest_wrapped__?
- is_fixture = hasattr(obj, "_pytestfixturefunction")
+ is_fixture = getfixturemarker(obj) is not None
return not (is_hidden_name or is_fixture)
|