()
| 89 | |
| 90 | |
| 91 | def test_block_add_hook(): |
| 92 | # Raising an exception should prevent a new hook from being added, |
| 93 | # but will not propagate out. |
| 94 | with TestHook(raise_on_events="sys.addaudithook") as hook1: |
| 95 | with TestHook() as hook2: |
| 96 | sys.audit("test_event") |
| 97 | assertIn("test_event", hook1.seen_events) |
| 98 | assertNotIn("test_event", hook2.seen_events) |
| 99 | |
| 100 | |
| 101 | def test_block_add_hook_baseexception(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…