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

Method test_getmodulecollector

testing/python/collect.py:335–339  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

333
334class TestFunction:
335 def test_getmodulecollector(self, pytester: Pytester) -> None:
336 item = pytester.getitem("def test_func(): pass")
337 modcol = item.getparent(pytest.Module)
338 assert isinstance(modcol, pytest.Module)
339 assert hasattr(modcol.obj, "test_func")
340
341 @pytest.mark.filterwarnings("default")
342 def test_function_as_object_instance_ignored(self, pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 2

getparentMethod · 0.80
getitemMethod · 0.45

Tested by

no test coverage detected