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

Function run_test_script

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

Source from the content-addressed store, hash-verified

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

Calls 5

titleFunction · 0.85
assert_python_okFunction · 0.85
basenameMethod · 0.80
printFunction · 0.50
runMethod · 0.45