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 @@ # 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)