Skip to content

Commit df6dc3c

Browse files
committed
Fix compatibility with pytest 8.4
pytest-dev/pytest#12473 removed `_pytestfixturefunction`. The `getfixturemarker` function is still private, but has existed across all pytest versions that we support. Fixes: bitprophet#33
1 parent 847a794 commit df6dc3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pytest_relaxed/classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
# NOTE: don't see any other way to get access to pytest innards besides using
88
# the underscored name :(
9+
from _pytest.fixtures import getfixturemarker
910
from _pytest.python import PyCollector
1011

1112

@@ -27,8 +28,7 @@ def istestfunction(obj, name):
2728
"teardown",
2829
"teardown_method",
2930
)
30-
# TODO: is this reliable? how about __pytest_wrapped__?
31-
is_fixture = hasattr(obj, "_pytestfixturefunction")
31+
is_fixture = getfixturemarker(obj) is not None
3232
return not (is_hidden_name or is_fixture)
3333

3434

0 commit comments

Comments
 (0)