MCPcopy Index your code
hub / github.com/python/cpython / test_search_path_exe

Method test_search_path_exe

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

Source from the content-addressed store, hash-verified

674 data["stdout"].strip())
675
676 def test_search_path_exe(self):
677 # Leave the .exe on the name to ensure we don't add it a second time
678 exe = Path("arbitrary-exe-name.exe").absolute()
679 exe.touch()
680 self.addCleanup(exe.unlink)
681 with self.py_ini(TEST_PY_DEFAULTS):
682 with self.script(f"#! /usr/bin/env {exe.name} -prearg") as script:
683 data = self.run_py(
684 [script, "-postarg"],
685 env={"PATH": f"{exe.parent};{os.getenv('PATH')}"},
686 )
687 self.assertEqual(f"{quote(exe)} -prearg {quote(script)} -postarg",
688 data["stdout"].strip())
689
690 def test_recursive_search_path(self):
691 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
run_pyMethod · 0.80
quoteFunction · 0.70
touchMethod · 0.45
scriptMethod · 0.45
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected