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

Method test_classmethod_is_discovered

testing/test_collection.py:781–793  ·  view source on GitHub ↗

Test that classmethods are discovered

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

779 print(s)
780
781 def test_classmethod_is_discovered(self, pytester: Pytester) -> None:
782 """Test that classmethods are discovered"""
783 p = pytester.makepyfile(
784 """
785 class TestCase:
786 @classmethod
787 def test_classmethod(cls) -> None:
788 pass
789 """
790 )
791 items, _reprec = pytester.inline_genitems(p)
792 ids = [x.getmodpath() for x in items] # type: ignore[attr-defined]
793 assert ids == ["TestCase.test_classmethod"]
794
795 def test_class_and_functions_discovery_using_glob(self, pytester: Pytester) -> None:
796 """Test that Python_classes and Python_functions config options work

Callers

nothing calls this directly

Calls 3

getmodpathMethod · 0.80
makepyfileMethod · 0.45
inline_genitemsMethod · 0.45

Tested by

no test coverage detected