(self, tmp_path: Path)
| 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")} |
nothing calls this directly
no test coverage detected