MCPcopy Index your code
hub / github.com/python/cpython / test_block_add_hook

Function test_block_add_hook

Lib/test/audit-tests.py:91–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89
90
91def 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
101def test_block_add_hook_baseexception():

Callers

nothing calls this directly

Calls 3

assertInFunction · 0.85
assertNotInFunction · 0.85
TestHookClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…