Commit aa75c40
gh-152548: Convert test_audit to the @runInSubprocess() decorator
sys.addaudithook() cannot be undone, so each test needs a fresh
interpreter. With @isolation.runInSubprocess() each test becomes an
ordinary TestCase method using self.assert* directly in the subprocess,
replacing the separate audit-tests.py driver script and the parsing of
events out of its stdout.
Per-test imports stay inside the methods, and a local requires_module()
decorator checks optional modules in the parent process, so a missing
module skips the test without first spawning the subprocess.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent bde526d commit aa75c40
2 files changed
Lines changed: 780 additions & 996 deletions
0 commit comments