MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_search_path_exe

Method test_search_path_exe

Lib/test/test_launcher.py:669–681  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

667 data["stdout"].strip())
668
669 def test_search_path_exe(self):
670 # Leave the .exe on the name to ensure we don't add it a second time
671 exe = Path("arbitrary-exe-name.exe").absolute()
672 exe.touch()
673 self.addCleanup(exe.unlink)
674 with self.py_ini(TEST_PY_DEFAULTS):
675 with self.script(f"#! /usr/bin/env {exe.name} -prearg") as script:
676 data = self.run_py(
677 [script, "-postarg"],
678 env={"PATH": f"{exe.parent};{os.getenv('PATH')}"},
679 )
680 self.assertEqual(f"{quote(exe)} -prearg {quote(script)} -postarg",
681 data["stdout"].strip())
682
683 def test_recursive_search_path(self):
684 stem = self.get_py_exe().stem

Callers

nothing calls this directly

Calls 10

PathClass · 0.90
absoluteMethod · 0.80
addCleanupMethod · 0.80
py_iniMethod · 0.80
scriptMethod · 0.80
run_pyMethod · 0.80
quoteFunction · 0.70
touchMethod · 0.45
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected