MCPcopy
hub / github.com/pex-tool/pex / test_find_python_sibling

Function test_find_python_sibling

tests/test_pyvenv_cfg.py:58–68  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

56
57
58def test_find_python_sibling(tmpdir):
59 # type: (Any) -> None
60
61 bin_dir = os.path.join(str(tmpdir), "bin")
62 python = os.path.join(bin_dir, "python")
63 touch(python)
64 with open(os.path.join(bin_dir, "pyvenv.cfg"), "w") as fp:
65 fp.write("home = foo")
66 cfg = PyVenvCfg.find(python)
67 assert cfg is not None
68 assert "foo" == cfg.home
69
70
71def test_find_venv_sibling(tmpdir):

Callers

nothing calls this directly

Calls 4

touchFunction · 0.90
joinMethod · 0.45
writeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected