Skip to content

Commit 22c0dac

Browse files
authored
change istestfunction to callable() (#8374)
1 parent b7f2d7c commit 22c0dac

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/_pytest/python.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,7 @@ def istestfunction(self, obj: object, name: str) -> bool:
384384
if isinstance(obj, staticmethod):
385385
# staticmethods need to be unwrapped.
386386
obj = safe_getattr(obj, "__func__", False)
387-
return (
388-
safe_getattr(obj, "__call__", False)
389-
and fixtures.getfixturemarker(obj) is None
390-
)
387+
return callable(obj) and fixtures.getfixturemarker(obj) is None
391388
else:
392389
return False
393390

0 commit comments

Comments
 (0)