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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

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