diff options
| author | Konge <zkonge@outlook.com> | 2020-07-03 21:06:46 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-03 21:06:46 (GMT) |
| commit | daa0fe03a517d335d48e65ace8e5da636e265a8f (patch) | |
| tree | d6504f9bc7ae8a6c8d14c0da18e6e46c138231fb /Lib/test/audit-tests.py | |
| parent | d160e0f8e283d0a8737644588b38e8c6a07c134f (diff) | |
| download | cpython-daa0fe03a517d335d48e65ace8e5da636e265a8f.zip cpython-daa0fe03a517d335d48e65ace8e5da636e265a8f.tar.gz cpython-daa0fe03a517d335d48e65ace8e5da636e265a8f.tar.bz2 | |
bpo-41162: Clear audit hooks later during finalization (GH-21222)
Diffstat (limited to 'Lib/test/audit-tests.py')
| -rw-r--r-- | Lib/test/audit-tests.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py index a58395b..ee6fc93 100644 --- a/Lib/test/audit-tests.py +++ b/Lib/test/audit-tests.py @@ -44,28 +44,6 @@ class TestHook: raise self.exc_type("saw event " + event) -class TestFinalizeHook: - """Used in the test_finalize_hooks function to ensure that hooks - are correctly cleaned up, that they are notified about the cleanup, - and are unable to prevent it. - """ - - def __init__(self): - print("Created", id(self), file=sys.stdout, flush=True) - - def __call__(self, event, args): - # Avoid recursion when we call id() below - if event == "builtins.id": - return - - print(event, id(self), file=sys.stdout, flush=True) - - if event == "cpython._PySys_ClearAuditHooks": - raise RuntimeError("Should be ignored") - elif event == "cpython.PyInterpreterState_Clear": - raise RuntimeError("Should be ignored") - - # Simple helpers, since we are not in unittest here def assertEqual(x, y): if x != y: @@ -128,10 +106,6 @@ def test_block_add_hook_baseexception(): pass -def test_finalize_hooks(): - sys.addaudithook(TestFinalizeHook()) - - def test_pickle(): import pickle |
