(script)
| 304 | |
| 305 | @support.requires_subprocess() |
| 306 | def 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") |
searching dependent graphs…