MCPcopy Create free account
hub / github.com/pytest-dev/pytest / istestfunction

Method istestfunction

src/_pytest/python.py:385–392  ·  view source on GitHub ↗
(self, obj: object, name: str)

Source from the content-addressed store, hash-verified

383 return self._matches_prefix_or_glob_option("python_classes", name)
384
385 def istestfunction(self, obj: object, name: str) -> bool:
386 if self.funcnamefilter(name) or self.isnosetest(obj):
387 if isinstance(obj, staticmethod):
388 # staticmethods need to be unwrapped.
389 obj = safe_getattr(obj, "__func__", False)
390 return callable(obj) and fixtures.getfixturemarker(obj) is None
391 else:
392 return False
393
394 def istestclass(self, obj: object, name: str) -> bool:
395 return self.classnamefilter(name) or self.isnosetest(obj)

Callers 1

Calls 3

funcnamefilterMethod · 0.95
isnosetestMethod · 0.95
safe_getattrFunction · 0.90

Tested by

no test coverage detected