summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon K <jackofspaces@gmail.com>2021-02-25 20:32:27 +0000
committerGitHub <noreply@github.com>2021-02-25 20:32:27 +0000
commit22c0dace3b67ac2aaf8d45f6f73ed9838c30e8eb (patch)
treebfd3e33bfe54ae98480453479344ed7d22203d3f
parentb7f2d7ca61d6169495e5780fffc252daaacd6583 (diff)
downloadpytest-22c0dace3b67ac2aaf8d45f6f73ed9838c30e8eb.tar.gz
change istestfunction to callable() (#8374)
-rw-r--r--src/_pytest/python.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/_pytest/python.py b/src/_pytest/python.py
index 944c395a8..40116ab9c 100644
--- a/src/_pytest/python.py
+++ b/src/_pytest/python.py
@@ -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