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

Method test_ensuresyspath_append

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

Source from the content-addressed store, hash-verified

256 assert m1 == m2
257
258 def test_ensuresyspath_append(self, tmp_path: Path) -> None:
259 root1 = tmp_path / "root1"
260 root1.mkdir()
261 file1 = root1 / "x123.py"
262 file1.touch()
263 assert str(root1) not in sys.path
264 import_path(file1, mode="append", root=tmp_path)
265 assert str(root1) == sys.path[-1]
266 assert str(root1) not in sys.path[:-1]
267
268 def test_invalid_path(self, tmp_path: Path) -> None:
269 with pytest.raises(ImportError):

Callers

nothing calls this directly

Calls 2

import_pathFunction · 0.90
mkdirMethod · 0.45

Tested by

no test coverage detected