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

Method test_import_after

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

Source from the content-addressed store, hash-verified

203 assert mod.value2 == "got it" # type: ignore[attr-defined]
204
205 def test_import_after(self, tmp_path: Path) -> None:
206 tmp_path.joinpath("xxxpackage").mkdir()
207 tmp_path.joinpath("xxxpackage", "__init__.py").touch()
208 mod1path = tmp_path.joinpath("xxxpackage", "module1.py")
209 mod1path.touch()
210 mod1 = import_path(mod1path, root=tmp_path)
211 assert mod1.__name__ == "xxxpackage.module1"
212 from xxxpackage import module1
213
214 assert module1 is mod1
215
216 def test_check_filepath_consistency(
217 self, monkeypatch: MonkeyPatch, tmp_path: Path

Callers

nothing calls this directly

Calls 2

import_pathFunction · 0.90
mkdirMethod · 0.45

Tested by

no test coverage detected