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

Method test_module_name_from_path

testing/test_pathlib.py:554–560  ·  view source on GitHub ↗
(self, tmp_path: Path)

Source from the content-addressed store, hash-verified

552 assert Data2.__module__ == "_src.m2.tests.test"
553
554 def test_module_name_from_path(self, tmp_path: Path) -> None:
555 result = module_name_from_path(tmp_path / "src/tests/test_foo.py", tmp_path)
556 assert result == "src.tests.test_foo"
557
558 # Path is not relative to root dir: use the full path to obtain the module name.
559 result = module_name_from_path(Path("/home/foo/test_foo.py"), Path("/bar"))
560 assert result == "home.foo.test_foo"
561
562 def test_insert_missing_modules(self) -> None:
563 modules = {"src.tests.foo": ModuleType("src.tests.foo")}

Callers

nothing calls this directly

Calls 1

module_name_from_pathFunction · 0.90

Tested by

no test coverage detected