MCPcopy
hub / github.com/pytest-dev/pytest / test_package_unimportable

Function test_package_unimportable

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

Source from the content-addressed store, hash-verified

442
443
444def test_package_unimportable(tmp_path: Path) -> None:
445 pkg = tmp_path / "pkg1-1"
446 pkg.mkdir()
447 pkg.joinpath("__init__.py").touch()
448 subdir = pkg / "subdir"
449 subdir.mkdir()
450 (pkg / "subdir/__init__.py").touch()
451 assert resolve_package_path(subdir) == subdir
452 xyz = subdir / "xyz.py"
453 xyz.touch()
454 assert resolve_package_path(xyz) == subdir
455 assert not resolve_package_path(pkg)
456
457
458def 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