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

Method test_global_file

testing/test_collection.py:642–652  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

640
641class Test_getinitialnodes:
642 def test_global_file(self, pytester: Pytester) -> None:
643 tmp_path = pytester.path
644 x = ensure_file(tmp_path / "x.py")
645 config = pytester.parseconfigure(x)
646 col = pytester.getnode(config, x)
647 assert isinstance(col, pytest.Module)
648 assert col.name == "x.py"
649 assert col.parent is not None
650 assert col.parent.parent is None
651 for parent in col.listchain():
652 assert parent.config is config
653
654 def test_pkgfile(self, pytester: Pytester) -> None:
655 """Verify nesting when a module is within a package.

Callers

nothing calls this directly

Calls 4

ensure_fileFunction · 0.85
listchainMethod · 0.80
parseconfigureMethod · 0.45
getnodeMethod · 0.45

Tested by

no test coverage detected