Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python38/lib64/python3.8/unittest/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python38/lib64/python3.8/unittest/__pycache__/async_case.cpython-38.pyc
U

��,a��@s0ddlZddlZddlmZGdd�de�ZdS)�N�)�TestCasecs�eZdZd�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd �fdd�	Z�ZS)!�IsolatedAsyncioTestCase�runTestcst��|�d|_d|_dS�N)�super�__init__�_asyncioTestLoop�_asyncioCallsQueue)�selfZ
methodName��	__class__��8/opt/alt/python38/lib64/python3.8/unittest/async_case.pyr"sz IsolatedAsyncioTestCase.__init__c�sdSrr�rrrr�
asyncSetUp'sz"IsolatedAsyncioTestCase.asyncSetUpc�sdSrrrrrr�
asyncTearDown*sz%IsolatedAsyncioTestCase.asyncTearDowncOs|j|f|�|�dSr)Z
addCleanup)r�func�args�kwargsrrr�addAsyncCleanup-s
z'IsolatedAsyncioTestCase.addAsyncCleanupcCs|��|�|j�dSr)ZsetUp�
_callAsyncrrrrr�
_callSetUp<sz"IsolatedAsyncioTestCase._callSetUpcCs|�|�dSr��_callMaybeAsync)r�methodrrr�_callTestMethod@sz'IsolatedAsyncioTestCase._callTestMethodcCs|�|j�|��dSr)rrZtearDownrrrr�
_callTearDownCsz%IsolatedAsyncioTestCase._callTearDowncOs|j|f|�|�dSrr)rZfunctionrrrrr�_callCleanupGsz$IsolatedAsyncioTestCase._callCleanupcOsL|jdk	st�|||�}t�|�s&t�|j��}|j�||f�|j�|�Sr�r	�AssertionError�inspectZisawaitable�
create_futurer
�
put_nowait�run_until_complete�rrrr�ret�futrrrrJs

z"IsolatedAsyncioTestCase._callAsynccOsP|jdk	st�|||�}t�|�rH|j��}|j�||f�|j�|�S|SdSrrr%rrrrRs


z'IsolatedAsyncioTestCase._callMaybeAsyncc
�s�t��|_}|�d�|��IdH}|��|dkr:dS|\}}z |IdH}|��s`|�|�Wqttfk
r|�Yqt	tj
fk
r�}z|��s�|�|�W5d}~XYqXqdSr)�asyncioZQueuer
Z
set_result�getZ	task_done�	cancelled�
SystemExit�KeyboardInterrupt�
BaseExceptionZCancelledErrorZ
set_exception)rr'ZqueueZqueryZ	awaitabler&Zexrrr�_asyncioLoopRunner\s 

z*IsolatedAsyncioTestCase._asyncioLoopRunnercCsX|jdkst�t��}t�|�|�d�||_|��}|�|�|��|_	|�
|�dS)NT)r	r r(Znew_event_loop�set_event_loopZ	set_debugr"Zcreate_taskr.Z_asyncioCallsTaskr$)r�loopr'rrr�_setupAsyncioLoopos

z)IsolatedAsyncioTestCase._setupAsyncioLoopc	Cs�|jdk	st�|j}d|_|j�d�|�|j���z�t�	|�}|sNW�vdS|D]}|�
�qR|�tj||dd���|D]0}|��r�q||�
�dk	r||�d|�
�|d��q||�|���W5t�d�|��XdS)NT)r0Zreturn_exceptionsz(unhandled exception during test shutdown)�message�	exception�task)r	r r
r#r$�joinr(r/�closeZ	all_tasksZcancelZgatherr*r3Zcall_exception_handlerZshutdown_asyncgens)rr0Z	to_cancelr4rrr�_tearDownAsyncioLoopys4

��

z,IsolatedAsyncioTestCase._tearDownAsyncioLoopNcs(|��zt��|�W�S|��XdSr)r1r7r�run)r�resultrrrr8�szIsolatedAsyncioTestCase.run)r)N)�__name__�
__module__�__qualname__rrrrrrrrrrr.r1r7r8�
__classcell__rrrrrs

"r)r(r!Zcaserrrrrr�<module>s

ZeroDay Forums Mini