diff options
author | Simon K <jackofspaces@gmail.com> | 2021-02-25 20:32:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-25 20:32:27 +0000 |
commit | 22c0dace3b67ac2aaf8d45f6f73ed9838c30e8eb (patch) | |
tree | bfd3e33bfe54ae98480453479344ed7d22203d3f /src | |
parent | b7f2d7ca61d6169495e5780fffc252daaacd6583 (diff) | |
download | pytest-22c0dace3b67ac2aaf8d45f6f73ed9838c30e8eb.tar.gz |
change istestfunction to callable() (#8374)
Diffstat (limited to 'src')
-rw-r--r-- | src/_pytest/python.py | 5 |
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 |