Skip to content

Commit c1a1073

Browse files
gh-152548: Convert test_audit to the test.support.isolated() decorator
Each audit test needs a fresh interpreter because sys.addaudithook() cannot be undone. @support.isolated() provides one, so the tests become ordinary TestCase methods using self.assert* in the subprocess, dropping the audit-tests.py driver script and the code that parsed events out of its stdout. test_excepthook stays a subprocess test: the "sys.excepthook" audit event only fires for an exception reaching the interpreter's top level, which an @isolated() body (run under unittest) never does. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent bcc35ee commit c1a1073

2 files changed

Lines changed: 743 additions & 988 deletions

File tree

0 commit comments

Comments
 (0)