change istestfunction to callable() (#8374)

This commit is contained in:
Simon K
2021-02-25 20:32:27 +00:00
committed by GitHub
parent b7f2d7ca61
commit 22c0dace3b

View File

@@ -384,10 +384,7 @@ class PyCollector(PyobjMixin, nodes.Collector):
if isinstance(obj, staticmethod):
# staticmethods need to be unwrapped.
obj = safe_getattr(obj, "__func__", False)
return (
safe_getattr(obj, "__call__", False)
and fixtures.getfixturemarker(obj) is None
)
return callable(obj) and fixtures.getfixturemarker(obj) is None
else:
return False