Your IP : 216.73.216.213
�
�0�i?+ � � � d Z ddlZddlZddlZddlmZ ddlmZ d� Z G d� dej � � Z e
dk r ej � � dS dS ) zTests for asyncio/timeouts.py� N)�tasks)�await_without_taskc �. � t j d � � d S )N)�asyncio�set_event_loop_policy� � �F/opt/alt/python311/lib64/python3.11/test/test_asyncio/test_timeouts.py�tearDownModuler s � ��!�$�'�'�'�'�'r c �� � e Zd Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z 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"d!S )"�TimeoutTestsc � �l K � | � t � � 5 t j d� � 4 �d {V ��}t j d� � � d {V �� d d d � � �d {V �� n# 1 �d {V ��swxY w Y d d d � � n# 1 swxY w Y | � |� � � � � d S �N�{�G�z�?�
)�assertRaises�TimeoutErrorr �timeout�sleep�
assertTrue�expired��self�cms r
�test_timeout_basiczTimeoutTests.test_timeout_basic so � � � �
�
�
�|�
,�
,� (� (���t�,�,�
(�
(�
(�
(�
(�
(�
(���m�B�'�'�'�'�'�'�'�'�'�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(����
(�
(�
(�
(� (� (� (� (� (� (� (� (� (� (� (���� (� (� (� (�
����
�
���%�%�%�%�%�4 �B�A%�B�%
A/ �/B�2A/ �3B�B� Bc � � K � t j � � }| � t � � 5 |� � � dz }t j |� � 4 �d {V ��}t j d� � � d {V �� d d d � � �d {V �� n# 1 �d {V ��swxY w Y d d d � � n# 1 swxY w Y | � |� � � � � | � ||�
� � � � d S r )r �get_running_loopr r �time�
timeout_atr r r �assertEqual�when)r �loop�deadliner s r
�test_timeout_at_basicz"TimeoutTests.test_timeout_at_basic s� � � � ��'�)�)��
�
�
�|�
,�
,� (� (��y�y�{�{�T�)�H��)�(�3�3�
(�
(�
(�
(�
(�
(�
(�r��m�B�'�'�'�'�'�'�'�'�'�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(�
(����
(�
(�
(�
(� (� (� (� (� (� (� (� (� (� (� (���� (� (� (� (�
����
�
���%�%�%�����2�7�7�9�9�-�-�-�-�-s5 �2B,�"B�=B,�
B �B,�B �B,�,B0�3B0c � �� K � t j � � }d}| � t � � 5 |� � � dz }t j |� � 4 �d {V ��} t j |� � 4 �d {V ��}t j d� � � d {V �� d d d � � �d {V �� n# 1 �d {V ��swxY w Y n# t j $ r d}� w xY wd d d � � �d {V �� n# 1 �d {V ��swxY w Y d d d � � n# 1 swxY w Y | � |� � | � |� � � � � | � |� � � � � d S �NFr r T)
r r r r r r r �CancelledErrorr r )r r# � cancelledr$ �cm1�cm2s r
�test_nested_timeoutsz!TimeoutTests.test_nested_timeouts! s� � � � ��'�)�)��� �
�
�
�|�
,�
,� � ��y�y�{�{�T�)�H��)�(�3�3�
�
�
�
�
�
�
�s��&�1�(�;�;� 0� 0� 0� 0� 0� 0� 0�s�%�m�B�/�/�/�/�/�/�/�/�/�0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0� 0���� 0� 0� 0� 0����-� � � � $�I������
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
� � � � � � � � � � � ���� � � � �
��� �"�"�"�������
�
�&�&�&�������
�
�&�&�&�&�&sq �2D�$C'�&B?� B-�B?�-
B7�7B?�:B7�;B?�>C'�?C�C'�D�'
C1 �1D�4C1 �5D�D�Dc � �~ K � d}| � t � � 5 t j d� � 4 �d {V �� t j d� � � d {V �� n# t j $ r d}� w xY w d d d � � �d {V �� n# 1 �d {V ��swxY w Y d d d � � n# 1 swxY w Y | � |� � d S r'