From 22c0dace3b67ac2aaf8d45f6f73ed9838c30e8eb Mon Sep 17 00:00:00 2001 From: Simon K Date: Thu, 25 Feb 2021 20:32:27 +0000 Subject: [PATCH] change istestfunction to callable() (#8374) --- src/_pytest/python.py | 5 +---- 1 file changed, 1 insertion(+), 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