????

Your IP : 3.149.255.21


Current Path : /lib/python3.10/unittest/__pycache__/
Upload File :
Current File : //lib/python3.10/unittest/__pycache__/async_case.cpython-310.pyc

o

�*�g��@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�fdd �Zd!d"�Z�ZS)%�IsolatedAsyncioTestCase�runTestcst��|�d|_d|_dS�N)�super�__init__�_asyncioTestLoop�_asyncioCallsQueue)�self�
methodName��	__class__��*/usr/lib/python3.10/unittest/async_case.pyr!s
z IsolatedAsyncioTestCase.__init__c���dSrr�rrrr�
asyncSetUp&��z"IsolatedAsyncioTestCase.asyncSetUpc�rrrrrrr�
asyncTearDown)rz%IsolatedAsyncioTestCase.asyncTearDowncO�|j|g|�Ri|��dSr)�
addCleanup)r�func�args�kwargsrrr�addAsyncCleanup,s
z'IsolatedAsyncioTestCase.addAsyncCleanupcCs|��|�|j�dSr)�setUp�
_callAsyncrrrrr�
_callSetUp;sz"IsolatedAsyncioTestCase._callSetUpcCs|�|�dSr��_callMaybeAsync)r�methodrrr�_callTestMethod?sz'IsolatedAsyncioTestCase._callTestMethodcCs|�|j�|��dSr)rr�tearDownrrrr�
_callTearDownBsz%IsolatedAsyncioTestCase._callTearDowncOrrr)r�functionrrrrr�_callCleanupFsz$IsolatedAsyncioTestCase._callCleanupcOs^|jdus	Jd��||i|��}t�|�sJ|�d���|j��}|j�||f�|j�|�S)N�$asyncio test loop is not initializedz returned non-awaitable�r	�inspect�isawaitable�
create_futurer
�
put_nowait�run_until_complete�rrrr�ret�futrrrrIs
z"IsolatedAsyncioTestCase._callAsynccOsT|jdus	Jd��||i|��}t�|�r(|j��}|j�||f�|j�|�S|S)Nr'r(r.rrrr Qs

z'IsolatedAsyncioTestCase._callMaybeAsyncc
�s��t��|_}|�d�	|��IdH}|��|durdS|\}}z|IdH}|��s2|�|�Wn'ttfy=�t	tj
fyZ}z|��sP|�|�WYd}~nd}~wwqr)�asyncio�Queuer
�
set_result�get�	task_done�	cancelled�
SystemExit�KeyboardInterrupt�
BaseException�CancelledError�
set_exception)rr0�queue�query�	awaitabler/�exrrr�_asyncioLoopRunner[s,�


�
���z*IsolatedAsyncioTestCase._asyncioLoopRunnercCs\|jdus	Jd��t��}t�|�|�d�||_|��}|�|�|��|_|�	|�dS)Nz%asyncio test loop already initializedT)
r	r1�new_event_loop�set_event_loop�	set_debugr+�create_taskr@�_asyncioCallsTaskr-)r�loopr0rrr�_setupAsyncioLoopns

z)IsolatedAsyncioTestCase._setupAsyncioLoopc
Cs$|jdus	Jd��|j}d|_|j�d�|�|j���zct�|�}|s8W|�|���t�d�|�	�dS|D]}|�
�q:|�tj|ddi��|D]}|��rUqN|�
�durf|�d|�
�|d��qN|�|���W|�|���t�d�|�	�dS|�|���t�d�|�	�w)Nr'�return_exceptionsTz(unhandled exception during test shutdown)�message�	exception�task)r	r
r,r-�joinr1�	all_tasks�shutdown_default_executorrB�close�cancel�gatherr6rJ�call_exception_handler�shutdown_asyncgens)rrF�	to_cancelrKrrr�_tearDownAsyncioLoopxsD

�
���
�

z,IsolatedAsyncioTestCase._tearDownAsyncioLoopNcs*|��zt��|�W|��S|��wr)rGr�runrU)r�resultr
rrrV�szIsolatedAsyncioTestCase.runcs|��t���|��dSr)rGr�debugrUrr
rrrX�s
zIsolatedAsyncioTestCase.debugcCs|jdur|��dSdSr)r	rUrrrr�__del__�s
�zIsolatedAsyncioTestCase.__del__)rr)�__name__�
__module__�__qualname__rrrrrr"r$r&rr r@rGrUrVrXrY�
__classcell__rrr
rrs"

$r)r1r)�caserrrrrr�<module>s

Page not found | The NCLEX Doctor

Page not found!

Sorry, this page is not available...