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

Method test_issue131_on__init__

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

Source from the content-addressed store, hash-verified

242 assert issubclass(ImportPathMismatchError, ImportError)
243
244 def test_issue131_on__init__(self, tmp_path: Path) -> None:
245 # __init__.py files may be namespace packages, and thus the
246 # __file__ of an imported module may not be ourselves
247 # see issue
248 tmp_path.joinpath("proja").mkdir()
249 p1 = tmp_path.joinpath("proja", "__init__.py")
250 p1.touch()
251 tmp_path.joinpath("sub", "proja").mkdir(parents=True)
252 p2 = tmp_path.joinpath("sub", "proja", "__init__.py")
253 p2.touch()
254 m1 = import_path(p1, root=tmp_path)
255 m2 = import_path(p2, root=tmp_path)
256 assert m1 == m2
257
258 def test_ensuresyspath_append(self, tmp_path: Path) -> None:
259 root1 = tmp_path / "root1"

Callers

nothing calls this directly

Calls 2

import_pathFunction · 0.90
mkdirMethod · 0.45

Tested by

no test coverage detected