HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/test/test_asyncio/__pycache__/test_asyncio_waitfor.cpython-38.pyc
U

/D�g��@sTddlZddlZddlZdd�ZGdd�d�ZGdd�dej�ZedkrPe��dS)	�NcCst�d�dS�N)�asyncioZset_event_loop_policy�rr�E/opt/cppython/lib/python3.8/test/test_asyncio/test_asyncio_waitfor.py�tearDownModulesrc@s$eZdZdZdZdd�Zdd�ZdS)�SlowTaskz? Task will run for this defined time, ignoring cancel requests g�������?cCs
d|_dS)NF)�exited��selfrrr�__init__
szSlowTask.__init__c�s\t��|j}|t��}|dkr$qRzt�|�IdHWqtjk
rNYqXqd|_dS)NrT)�time�	monotonic�TASK_TIMEOUTr�sleep�CancelledErrorr)r
ZexitatZtosleeprrr�runszSlowTask.runN)�__name__�
__module__�__qualname__�__doc__rrrrrrrr	src@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�AsyncioWaitForTestc�s\t�}t�t�|��|jd��}t�d�IdH|��t�|h�IdH|�	|j
�dS)N�r)rrZcreate_task�wait_forrrr�cancel�wait�
assertTruer)r
�tZwaitfortaskrrr� atest_asyncio_wait_for_cancelled!sz3AsyncioWaitForTest.atest_asyncio_wait_for_cancelledcCst�|���dSr)rrrr	rrr�test_asyncio_wait_for_cancelled+sz2AsyncioWaitForTest.test_asyncio_wait_for_cancelledc�sNt�}z t�|��|jd�IdHWntjk
r<YnX|�|j�dS)Nr)rrrrr�TimeoutErrorrr)r
rrrr�atest_asyncio_wait_for_timeout.s z1AsyncioWaitForTest.atest_asyncio_wait_for_timeoutcCst�|���dSr)rrr r	rrr�test_asyncio_wait_for_timeout8sz0AsyncioWaitForTest.test_asyncio_wait_for_timeoutN)rrrrrr r!rrrrrs

r�__main__)	rZunittestrrrZTestCaserr�mainrrrr�<module>s