MCPcopy
hub / github.com/pytest-dev/pytest / isnosetest

Method isnosetest

src/_pytest/python.py:357–364  ·  view source on GitHub ↗

Look for the __test__ attribute, which is applied by the @nose.tools.istest decorator.

(self, obj: object)

Source from the content-addressed store, hash-verified

355 return self._matches_prefix_or_glob_option("python_functions", name)
356
357 def isnosetest(self, obj: object) -> bool:
358 """Look for the __test__ attribute, which is applied by the
359 @nose.tools.istest decorator.
360 """
361 # We explicitly check for "is True" here to not mistakenly treat
362 # classes with a custom __getattr__ returning something truthy (like a
363 # function) as test classes.
364 return safe_getattr(obj, "__test__", False) is True
365
366 def classnamefilter(self, name: str) -> bool:
367 return self._matches_prefix_or_glob_option("python_classes", name)

Callers 2

istestfunctionMethod · 0.95
istestclassMethod · 0.95

Calls 1

safe_getattrFunction · 0.90

Tested by

no test coverage detected