HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/unittest/test/__pycache__/test_async_case.cpython-310.pyc
o

�i}/�@s^ddlZddlZddlmZGdd�de�Zdd�ZGdd�dej�Ze	d	kr-e�
�dSdS)
�N)�supportc@seZdZdS)�MyExceptionN)�__name__�
__module__�__qualname__�rr�:/usr/local/lib/python3.10/unittest/test/test_async_case.pyrsrcCst�d�dS�N)�asyncioZset_event_loop_policyrrrr�tearDownModule
src@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�
TestAsyncCaseNcCs|�tj�dSr	)�
addCleanupr�
gc_collect��selfrrr�setUpszTestAsyncCase.setUpcs�gd��G��fdd�dtj�}g�|d�}|��}|�|jg�|�|jg�|����g�|d�}|��|����|��|����dS)N)r�
asyncSetUp�test�
asyncTearDown�tearDown�cleanup6�cleanup5�cleanup4�cleanup3�cleanup2�cleanup1cs�eZdZ�fdd�Z��fdd�Z��fdd�Z��fdd�Z��fd	d
�Z��fdd�Z��fd
d�Z	��fdd�Z
��fdd�Z��fdd�Z��fdd�Z
dS)z+TestAsyncCase.test_full_cycle.<locals>.Testcs2|��g���d�|�|j�|�|j�dS)Nr)�assertEqual�appendr
�on_cleanup1�addAsyncCleanup�on_cleanup2r��eventsrrr#s
z1TestAsyncCase.test_full_cycle.<locals>.Test.setUpc��<�|���dd����d�|�|j�|�|j�dS)N�r)rrr
�on_cleanup3r�on_cleanup4r�r"Zexpectedrrr)�
�
z6TestAsyncCase.test_full_cycle.<locals>.Test.asyncSetUpc�r#)N�r)rrr
�on_cleanup5r�on_cleanup6rr'rr�	test_func/r(z5TestAsyncCase.test_full_cycle.<locals>.Test.test_funcc��$�|���dd����d�dS)N�r�rrrr'rrr5��z9TestAsyncCase.test_full_cycle.<locals>.Test.asyncTearDownc�"|���dd����d�dS)N�rr/rr'rrr9�z4TestAsyncCase.test_full_cycle.<locals>.Test.tearDowncr1)N�
rr/rr'rrr=r3z7TestAsyncCase.test_full_cycle.<locals>.Test.on_cleanup1c�r-)N�	rr/rr'rrr Ar0z7TestAsyncCase.test_full_cycle.<locals>.Test.on_cleanup2cr1)N�rr/rr'rrr%Er3z7TestAsyncCase.test_full_cycle.<locals>.Test.on_cleanup3c�r-)N�rr/rr'rrr&Ir0z7TestAsyncCase.test_full_cycle.<locals>.Test.on_cleanup4cr1)N�rr/rr'rrr*Mr3z7TestAsyncCase.test_full_cycle.<locals>.Test.on_cleanup5c�r-)N�rr/rr'rrr+Qr0z7TestAsyncCase.test_full_cycle.<locals>.Test.on_cleanup6N)rrrrrr,rrrr r%r&r*r+rr'rr�Test"sr:r,)�unittest�IsolatedAsyncioTestCase�runr�errorsZfailures�debug�
doCleanups�rr:r�resultrr'r�test_full_cycles3zTestAsyncCase.test_full_cyclecs�G�fdd�dtj�}g�|d�}|��}|��ddg�|�|jdd|�|�d|jdd�g�|d�}|�|j�z|�	�Wn	t
yNYnw|�d	�|��dg�|��|��ddg�dS)
Nc�<eZdZ�fdd�Z�fdd�Z�fdd�Z�fdd�Zd	S)
z3TestAsyncCase.test_exception_in_setup.<locals>.Testc�����d�|�|j�t���Nr�rr�
on_cleanuprrr!rrre��
z>TestAsyncCase.test_exception_in_setup.<locals>.Test.asyncSetUpc�����d�dS�Nr�rrr!rrr,j��z=TestAsyncCase.test_exception_in_setup.<locals>.Test.test_funcc�rJ�NrrLrr!rrrmrMzATestAsyncCase.test_exception_in_setup.<locals>.Test.asyncTearDownc�rJ�N�cleanuprLrr!rrrHprMz>TestAsyncCase.test_exception_in_setup.<locals>.Test.on_cleanupN�rrrrr,rrHrr!rrr:ds
r:r,rrPrrr$� Expected a MyException exception�
r;r<r=rZassertIsr>�assertInr
�_tearDownAsyncioLoopr?r�failr@rArr!r�test_exception_in_setupcs&�
z%TestAsyncCase.test_exception_in_setupcs�G�fdd�dtj�}g�|d�}|��}|��gd��|�|jdd|�|�d|jdd�g�|d�}|�|j�z|�	�Wn	t
yNYnw|�d�|��d	d
g�|��|��gd��dS)NcrD)
z2TestAsyncCase.test_exception_in_test.<locals>.Testc�rJrFrLrr!rrr�rMz=TestAsyncCase.test_exception_in_test.<locals>.Test.asyncSetUpc�rErKrGrr!rrr,�rIz<TestAsyncCase.test_exception_in_test.<locals>.Test.test_funcc�rJrNrLrr!rrr�rMz@TestAsyncCase.test_exception_in_test.<locals>.Test.asyncTearDownc�rJrOrLrr!rrrH�rMz=TestAsyncCase.test_exception_in_test.<locals>.Test.on_cleanupNrQrr!rrr:�s
r:r,�rrrrPrrr$rRrr�rrrPrSrArr!r�test_exception_in_test��&�
z$TestAsyncCase.test_exception_in_testcs�G�fdd�dtj�}g�|d�}|��}|��gd��|�|jdd|�|�d|jdd�g�|d�}|�|j�z|�	�Wn	t
yNYnw|�d�|��gd	��|��|��gd��dS)
NcrD)
z7TestAsyncCase.test_exception_in_tear_down.<locals>.Testc�rJrFrLrr!rrr�rMzBTestAsyncCase.test_exception_in_tear_down.<locals>.Test.asyncSetUpc�s���d�|�|j�dSrK)rrrHrr!rrr,�s�
zATestAsyncCase.test_exception_in_tear_down.<locals>.Test.test_funcc�����d�t��rN�rrrr!rrr���
zETestAsyncCase.test_exception_in_tear_down.<locals>.Test.asyncTearDownc�rJrOrLrr!rrrH�rMzBTestAsyncCase.test_exception_in_tear_down.<locals>.Test.on_cleanupNrQrr!rrr:�s
r:r,rXrrr$rR)rrrrSrArr!r�test_exception_in_tear_down�r[z)TestAsyncCase.test_exception_in_tear_downcs�G�fdd�dtj�}g�|d�}|��}|��gd��|�|jdd|�|�d|jdd�|�d|jdd�g�|d�}|�|j�z|�	�Wn	t
yYYnw|�d	�|��gd
��|��|��gd��dS)NcsHeZdZ�fdd�Z�fdd�Z�fdd�Z�fdd�Z�fd	d
�ZdS)z;TestAsyncCase.test_exception_in_tear_clean_up.<locals>.Testc�rJrFrLrr!rrr�rMzFTestAsyncCase.test_exception_in_tear_clean_up.<locals>.Test.asyncSetUpc�s(���d�|�|j�|�|j�dSrK)rrrr rr!rrr,�s�
zETestAsyncCase.test_exception_in_tear_clean_up.<locals>.Test.test_funcc�rJrNrLrr!rrr�rMzITestAsyncCase.test_exception_in_tear_clean_up.<locals>.Test.asyncTearDownc�����d�td��)Nrz
some errorr]rr!rrr���
zGTestAsyncCase.test_exception_in_tear_clean_up.<locals>.Test.on_cleanup1c�r`)Nrzother errorr]rr!rrr �razGTestAsyncCase.test_exception_in_tear_clean_up.<locals>.Test.on_cleanup2N)rrrrr,rrr rr!rrr:�sr:r,)rrrrrrzMyException: other errorr$zMyException: some errorrR)rrrrrSrArr!r�test_exception_in_tear_clean_up�s(�
z-TestAsyncCase.test_exception_in_tear_clean_upcs>g�G�fdd�dtj�}|d�}|��|��gd��dS)Ncs,eZdZdd�Z�fdd�Z�fdd�ZdS)z:TestAsyncCase.test_cleanups_interleave_order.<locals>.Testc�s>�|�|jd�|�|jd�|�|jd�|�|jd�dS)Nr$r)r.r2)r�on_sync_cleanup�on_async_cleanuprrrrr,�s
�zDTestAsyncCase.test_cleanups_interleave_order.<locals>.Test.test_funcc�����d|���dS)Nz
sync_cleanup rL�r�valr!rrrc��zJTestAsyncCase.test_cleanups_interleave_order.<locals>.Test.on_sync_cleanupc�re)Nzasync_cleanup rLrfr!rrrdrhzKTestAsyncCase.test_cleanups_interleave_order.<locals>.Test.on_async_cleanupN)rrrr,rcrdrr!rrr:�sr:r,)zasync_cleanup 4zsync_cleanup 3zasync_cleanup 2zsync_cleanup 1)r;r<r=r)rr:rrr!r�test_cleanups_interleave_order�s

z,TestAsyncCase.test_cleanups_interleave_ordercszg�G�fdd�dtj�}|d�}|��}|�|���|d�}|��|��ddg�|d�}|��}|�|���dS)Ncs,eZdZ�fdd�Z�fdd�Zdd�ZdS)zATestAsyncCase.test_base_exception_from_async_method.<locals>.Testc�r\)N�	test_base)r�
BaseExceptionrr!rrrjr^zKTestAsyncCase.test_base_exception_from_async_method.<locals>.Test.test_basec�rJ)N�test_no_errrLrr!rrrlrMzMTestAsyncCase.test_base_exception_from_async_method.<locals>.Test.test_no_errc�s
�t���r	)r
�CancelledErrorrrrr�test_cancels�zMTestAsyncCase.test_base_exception_from_async_method.<locals>.Test.test_cancelN)rrrrjrlrnrr!rrr:sr:rjrlrn)r;r<r=ZassertFalseZ
wasSuccessfulr�rr:r�outputrr!r�%test_base_exception_from_async_methodsz3TestAsyncCase.test_base_exception_from_async_methodcs8d�G�fdd�dtj�}|d�}|��}|���dS)NFcseZdZ�fdd�ZdS)z;TestAsyncCase.test_cancellation_hanging_tasks.<locals>.Testc�s��fdd�}t�|��dS)Nc�s0�zt�d�IdHWdStjyd��w)Nr$T)r
�sleeprmr��	cancelledrr�coro/s��z[TestAsyncCase.test_cancellation_hanging_tasks.<locals>.Test.test_leaking_task.<locals>.coro)r
Zcreate_task)rrursrr�test_leaking_task.s�	zMTestAsyncCase.test_cancellation_hanging_tasks.<locals>.Test.test_leaking_taskN)rrrrvrrsrrr:-sr:rv)r;r<r=Z
assertTruerorrsr�test_cancellation_hanging_tasks+s

z-TestAsyncCase.test_cancellation_hanging_taskscs�G�fdd�dtj�}g�|d�}|��}|��gd��|�d|jdd�g�|d�}|�|j�z|��Wn	t	yCYnw|�
d�|��d	d
g�|��|��gd��dS)NcrD)
z8TestAsyncCase.test_debug_cleanup_same_loop.<locals>.Testc�s2�dd�}t�|��}|�|j|���d�dS)Nc�s�t�d�IdHdS)Nr)r
rrrrrrruArhzQTestAsyncCase.test_debug_cleanup_same_loop.<locals>.Test.asyncSetUp.<locals>.coror)r
Z
ensure_futurerrPr)rru�futr!rrr@s
�zCTestAsyncCase.test_debug_cleanup_same_loop.<locals>.Test.asyncSetUpc�r\rKr]rr!rrr,Gr^zBTestAsyncCase.test_debug_cleanup_same_loop.<locals>.Test.test_funcc�rJrNrLrr!rrrKrMzFTestAsyncCase.test_debug_cleanup_same_loop.<locals>.Test.asyncTearDownc�s>�zt�|g�IdH��d�WdSddl}|���)NrPr)r
�waitr�	traceback�	print_exc)rrxrzr!rrrPNs�z@TestAsyncCase.test_debug_cleanup_same_loop.<locals>.Test.cleanupN)rrrrr,rrPrr!rrr:?s
r:r,rXrrr$rRrrrY)r;r<r=rrTr>r
rUr?rrVr@rArr!r�test_debug_cleanup_same_loop>s$�
z*TestAsyncCase.test_debug_cleanup_same_loop)rrrZmaxDiffrrCrWrZr_rbrirqrwr|rrrrrsM%$$*r�__main__)r
r;rr�	ExceptionrrZTestCaserr�mainrrrr�<module>s`�