run-cli-helper-catches-systemexit

IN premise

The `run_cli` test harness intercepts `SystemExit` to extract exit codes, preventing argparse errors or explicit `sys.exit()` calls from terminating the test process.

Summary

The test helper function captures SystemExit exceptions instead of letting them kill the test runner, so tests can check what exit code a CLI command would have produced without actually crashing. This matters because argparse raises SystemExit on bad input, and without this interception, a single bad-arguments test would abort the entire test suite.

Details

Sourceentries/2026/04/29/tests-test_cli.md