File: D:/Python311/Lib/test/test_asyncio/__pycache__/test_waitfor.cpython-311.opt-2.pyc
�
��Vc# � � � d dl Z d dlZd dlZd� ZdZ G d� d� � Z G d� dej � � Zedk r ej � � dS dS ) � Nc �. � t j d � � d S �N)�asyncio�set_event_loop_policy� � �2D:\Python311\Lib\test\test_asyncio\test_waitfor.py�tearDownModuler
s � ��!�$�'�'�'�'�'r g-C��6?c � � e Zd Z dZd� Zd� ZdS )�SlowTask皙�����?c � � d| _ d S )NF)�exited��selfs r �__init__zSlowTask.__init__ s
� �����r c � �� K � t j � � | j z } |t j � � z
}|dk rn2 t j |� � � d {V �� n# t j $ r Y nw xY w�Od| _ d S )NTr )�time� monotonic�TASK_TIMEOUTr �sleep�CancelledErrorr )r �exitat�tosleeps r �runzSlowTask.run s� � � � ���!�!�D�$5�5�� ��t�~�/�/�/�G��!�|�
��
��m�G�,�,�,�,�,�,�,�,�,�,���)�
�
�
���
���� � ����s �A �A*�)A*N)�__name__�
__module__�__qualname__r r r r r r r r s: � � � � � �I��L�� � �
�
�
�
�
r r c �n � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
d� Zd
� Zd� Zd� Zd� ZdS )�AsyncioWaitForTestc � �n K � t � � }t j t j |� � � |j dz � � � � }t j d� � � d {V �� |� � � t j |h� � � d {V �� | � |j
� � d S )N� r )r r �create_task�wait_forr r r �cancel�wait�
assertTruer )r �t�waitfortasks r �test_asyncio_wait_for_cancelledz2AsyncioWaitForTest.test_asyncio_wait_for_cancelled) s� � � � ��J�J���)���Q�U�U�W�W�a�n�q�&8�9�9�;� ;���m�A�����������������l�K�=�)�)�)�)�)�)�)�)�)������!�!�!�!�!r c � �� K � t � � } t j |� � � |j dz � � � d {V �� n# t j $ r Y nw xY w| � |j � � d S )Nr"