Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/audit-tests.cpython-311.opt-1.pyc |
�
�Ke5. � �` � 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� Zedk r7ddlm Z e � � ej! d Z" e#� � e" � � dS dS ) z�This 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 �L � e Zd ZdZdefd�Zd� Zd� Zd� Ze d� � � Z
d� ZdS ) �TestHookz�Used 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 �B � |pd| _ || _ g | _ d| _ d S )N� F)�raise_on_events�exc_type�seen�closed)�selfr r s �:/usr/local/apps/python3/lib/python3.11/test/audit-tests.py�__init__zTestHook.__init__ s( � �.�4�"��� ��
��� ������ c �. � t j | � � | S �N)�sys�addaudithook�r �as r � __enter__zTestHook.__enter__ s � ��������r c �. � | � � � d S r )�closer s r �__exit__zTestHook.__exit__ s � ��
�
�����r c � � d| _ d S )NT)r
�r s r r zTestHook.close! s
� �����r c �$ � d� | j D � � S )Nc � � g | ]
}|d ��S )r r ��.0�is r �
<listcomp>z(TestHook.seen_events.<locals>.<listcomp>&