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