Problem
When tools/run_all_examples.py runs an example script that fails, the captured subprocess output (stdout/stderr) is silently discarded. It is only shown when --verbose is passed manually, making it hard to diagnose failures at a glance.
Proposed Fix
Change launch_example to return (success, stdout, stderr) instead of a plain bool, then always print the captured output in main() when a script fails.
launch_example signature change
def launch_example(cmdline_args: list[str], env_variables: dict[str, str]) -> tuple[bool, str, str]:
- On success:
return (True, result.stdout, result.stderr)
- On
CalledProcessError: return (False, error.stdout, error.stderr)
- Remove the now-unused
verbose parameter
Call site update in main()
run_success, out, err = launch_example([sys.executable, script_path, *example_args], env_variables=env_variables)
Display on failure
if not run_success:
if out:
print(out)
if err:
print(err, file=sys.stderr)
sys.exit(1)
Files
tools/run_all_examples.py
Problem
When
tools/run_all_examples.pyruns an example script that fails, the captured subprocess output (stdout/stderr) is silently discarded. It is only shown when--verboseis passed manually, making it hard to diagnose failures at a glance.Proposed Fix
Change
launch_exampleto return(success, stdout, stderr)instead of a plainbool, then always print the captured output inmain()when a script fails.launch_examplesignature changereturn (True, result.stdout, result.stderr)CalledProcessError:return (False, error.stdout, error.stderr)verboseparameterCall site update in
main()Display on failure
Files
tools/run_all_examples.py