python (3.12.0)
͑e4 b d Z ddlZddlZddlZ G d d Zd Zd Zd Zd Zej d Z
d
Zd Zd Z
d
Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d! Z"e#d"k( r,dd#l$m%Z% e% ejL d$ Z' e( e' yy)%zThis script contains the actual auditing tests.
It should not be imported directly, but should be run by the test_audit
module with arguments identifying each test.
Nc D e Zd ZdZdefdZd Zd Zd Ze d Z
d Zy) TestHookzUsed in standard hook tests to collect any logged events.
Should be used in a with block to ensure that it has no impact
after the test completes.
Nc D |xs d| _ || _ g | _ d| _ y )N F)raise_on_eventsexc_typeseenclosed)selfr r s D/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/audit-tests.py__init__zTestHook.__init__ s$ .4"
c 0 t j | | S N)sysaddaudithookr as r __enter__zTestHook.__enter__ s r c $ | j y r )closer s r __exit__zTestHook.__exit__ s
r c d| _ y )NT)r
r s r r zTestHook.close! s r c F | j D cg c] }|d c}S c c}w )Nr )r )r is r seen_eventszTestHook.seen_events$ s "ii(!(((s c | j ry | j j ||f || j v r| j d|z y )Nz
saw event )r
r appendr r )r eventargss r __call__zTestHook.__call__( sI ;; %'D(((--u 455 )r )__name__
__module____qualname____doc__RuntimeErrorr
r r r propertyr r"