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

Function test_package_unimportable

testing/test_pathlib.py:325–336  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

323
324
325def test_package_unimportable(tmp_path: Path) -> None:
326 pkg = tmp_path / "pkg1-1"
327 pkg.mkdir()
328 pkg.joinpath("__init__.py").touch()
329 subdir = pkg.joinpath("subdir")
330 subdir.mkdir()
331 pkg.joinpath("subdir/__init__.py").touch()
332 assert resolve_package_path(subdir) == subdir
333 xyz = subdir.joinpath("xyz.py")
334 xyz.touch()
335 assert resolve_package_path(xyz) == subdir
336 assert not resolve_package_path(pkg)
337
338
339def test_access_denied_during_cleanup(tmp_path: Path, monkeypatch: MonkeyPatch) -> None:

Callers

nothing calls this directly

Calls 2

resolve_package_pathFunction · 0.90
mkdirMethod · 0.45

Tested by

no test coverage detected