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

Function run_test_script

Lib/test/support/script_helper.py:306–324  ·  view source on GitHub ↗
(script)

Source from the content-addressed store, hash-verified

304
305@support.requires_subprocess()
306def run_test_script(script):
307 # use -u to try to get the full output if the test hangs or crash
308 if support.verbose:
309 def title(text):
310 return f"===== {text} ======"
311
312 name = f"script {os.path.basename(script)}"
313 print()
314 print(title(name), flush=True)
315 # In verbose mode, the child process inherit stdout and stdout,
316 # to see output in realtime and reduce the risk of losing output.
317 args = [sys.executable, "-E", "-X", "faulthandler", "-u", script, "-v"]
318 proc = subprocess.run(args)
319 print(title(f"{name} completed: exit code {proc.returncode}"),
320 flush=True)
321 if proc.returncode:
322 raise AssertionError(f"{name} failed")
323 else:
324 assert_python_ok("-u", script, "-v")

Calls 4

titleFunction · 0.85
assert_python_okFunction · 0.85
basenameMethod · 0.45
runMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…