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.7/test/test_asyncio/__pycache__/test_futures.cpython-37.pyc
B

��gri�@s�dZddlZddlZddlZddlZddlZddlZddlmZddl	Z	ddl	m
Z
ddlmZ
ddlmZdd�Zd	d
�Zdd�ZGd
d�d�ZGdd�de
j�ZGdd�d�Ze�ee
d�d�Gdd�dee
j��Ze�ee
d�d�Gdd�dee
j��ZGdd�dee
j�ZGdd�d�Ze�ee
d�d�Gdd�dee
j��Ze�ee
d�d�Gdd �d ee
j��ZGd!d"�d"ee
j�ZGd#d$�d$�Z Gd%d&�d&e e
j�Z!Gd'd(�d(e e
j�Z"e#d)k�r�e�$�dS)*zTests for futures.py.�N)�mock)�futures)�utils)�supportcCs|S)N�)�frr�:/usr/local/lib/python3.7/test/test_asyncio/test_futures.py�	_fakefuncsr	cCsdS)Nrrrrr�first_cbsr
cCsdS)Nrrrrr�last_cbsrc@s\eZdZdZdZdZdZdd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�ZdS)�
DuckFutureFNcCs|��rdSd|_dS)NFT)�done�_DuckFuture__cancelled)�selfrrr�cancel&szDuckFuture.cancelcCs|jS)N)r)rrrr�	cancelled,szDuckFuture.cancelledcCs|jp|jdk	p|jdk	S)N)r�_DuckFuture__result�_DuckFuture__exception)rrrrr
/s
zDuckFuture.donecCs"|��rt�|jdk	r|j�|jS)N)r�AssertionErrorrr)rrrr�result4s
zDuckFuture.resultcCs|��rt�|jS)N)rrr)rrrr�	exception:szDuckFuture.exceptioncCs"|��rt�|dk	st�||_dS)N)r
rr)rrrrr�
set_result>szDuckFuture.set_resultcCs"|��rt�|dk	st�||_dS)N)r
rr)rrrrr�
set_exceptionCszDuckFuture.set_exceptionccs(|��sd|_|V|��s t�|��S)NT)r
�_asyncio_future_blockingrr)rrrr�__iter__Hs
zDuckFuture.__iter__)�__name__�
__module__�__qualname__rrrrrrr
rrrrrrrrrrsrcs,eZdZ�fdd�Zdd�Zdd�Z�ZS)�	DuckTestscs&t���|��|_|�|jj�dS)N)�super�setUp�
new_test_loop�loop�
addCleanup�close)r)�	__class__rrr Rs

zDuckTests.setUpcCs t�}t�|�}||kst�dS)N)r�asyncio�wrap_futurer)rr�grrr�test_wrap_futureWs
zDuckTests.test_wrap_futurecCs t�}t�|�}||kst�dS)N)rr&Z
ensure_futurer)rrr(rrr�test_ensure_future\s
zDuckTests.test_ensure_future)rrrr r)r*�
__classcell__rr)r%rrPsrcs�eZdZdd�Z�fdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Ze�d!�d"d#��Ze�d!�d$d%��Ze�d!�d&d'��Ze�d!�d(d)��Ze�d!�d*d+��Ze�d!�d,d-��Ze�d!�d.d/��Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!e�d!�d<d=��Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'dHdI�Z(�Z)S)J�BaseFutureTestscOs|j||�S)N)�cls)r�args�kwargsrrr�_new_futuredszBaseFutureTests._new_futurecs&t���|��|_|�|jj�dS)N)rr r!r"r#r$)r)r%rrr gs

zBaseFutureTests.setUpcCs�Gdd�d�}|�t�|��|�t�|���|�t�d��|�t�t����|j|jd�}|�t�|��|�t�t|���|�t�t�t|����|�	�dS)Nc@seZdZdZdd�ZdS)z/BaseFutureTests.test_isfuture.<locals>.MyFutureNcSs
d|_dS)NF)r)rrrr�__init__psz8BaseFutureTests.test_isfuture.<locals>.MyFuture.__init__)rrrrr1rrrr�MyFuturemsr2�)r")
�assertFalser&�isfuture�
assertTruerZMockr0r"�typer)rr2rrrr�
test_isfuturelszBaseFutureTests.test_isfuturecCsD|j|jd�}|�|���|�|���|��|�|���dS)N)r")r0r"r4rr
rr6)rrrrr�test_initial_state�s
z"BaseFutureTests.test_initial_statecCs:t�|j�|��}|�|j|j�|�|��|j�dS)N)r&Zset_event_loopr"r0�assertIs�_loop�get_loop)rrrrr�"test_init_constructor_default_loop�sz2BaseFutureTests.test_init_constructor_default_loopcCs|�t|jd�dS)N�*)�assertRaises�	TypeErrorr0)rrrr�test_constructor_positional�sz+BaseFutureTests.test_constructor_positionalc	CsF|jj|j|jd�}|�tj|j�|jj|j|jd�}|�tj|j�|jj|j|jd�}|�tt	f��|�
d�WdQRX|jj|j|jd�}|�tt	f��|�t�WdQRX|jj|j|jd�}|�tt	f��|�
�WdQRX|jj|j|jd�}|�tt	f��|�dd��WdQRX|jj|j|jd�}|�tt	f��|�dd��WdQRX|jj|j|jd�}yt|�Wntt	fk
�r�YnX|jj|j|jd�}y|��Wntk
�r�YnX|jj|j|jd�}yt|�Wntk
�rYnX|jj|j|jd�}|�|���|�|���dS)N)r"cSsdS)Nr)rrrr�<lambda>��z4BaseFutureTests.test_uninitialized.<locals>.<lambda>cSsdS)Nr)rrrrrB�rC)r-�__new__r"r?r&�InvalidStateErrorrr�RuntimeError�AttributeErrorrr�	Exceptionr�add_done_callback�remove_done_callback�repr�	__await__�iterr4rr
)r�futrrr�test_uninitialized�sJz"BaseFutureTests.test_uninitializedcCs�|j|jd�}|�|���|�|���|�|���|�tj|j	�|�tj|j
�|�tj|jd�|�tj|j
d�|�|���dS)N)r")r0r"r6rrr
r?r&ZCancelledErrorrrrErrr4)rrrrr�test_cancel�szBaseFutureTests.test_cancelcCs�|j|jd�}|�tj|j�|�d�|�|���|�	|�
��|�|��d�|�|��d�|�tj|jd�|�tj|j
d�|�|���dS)N)r"r>)r0r"r?r&rErrr4rr6r
�assertEqualrrr)rrrrr�test_result�s
zBaseFutureTests.test_resultcCs�t�}|j|jd�}|�tj|j�|�td|j	t
�|�	|�|�|���|�
|���|�t|j�|�|��|�|�tj|jd�|�tj|j	d�|�|���dS)N)r"z!StopIteration .* cannot be raised)rFr0r"r?r&rEr�assertRaisesRegexr@r�
StopIterationr4rr6r
rrQrr)r�excrrrr�test_exception�s

zBaseFutureTests.test_exceptioncCs,|j|jd�}|�t�|�|��t�dS)N)r")r0r"rrF�assertIsInstancer)rrrrr�test_exception_class�s
z$BaseFutureTests.test_exception_classcsn|j|jd���fdd�}|�}|�t|�d�|�t|�����d�|�t|�d�|�t|�d�dS)N)r"c3s2dV�EdH}d|fV�EdH}d|fVdS)N�A�B�Cr)�x�y)rrr�fixture�s



z6BaseFutureTests.test_yield_from_twice.<locals>.fixturerYr>)rZr>)r[r>)r0r"rQ�nextr)rr^r(r)rr�test_yield_from_twice�s
z%BaseFutureTests.test_yield_from_twicec
Cs�|j�d�|j|jd�}|jd}|�t|�d|jj�d|d�d|d�d	��|��|j�d
�|j|jd�}|�t|�d|jj�d��|��|j|jd�}|��|�t|�d|jj�d��|j|jd�}|�	d
�|�t|�d|jj�d��|�|�
�d
�t�}|j|jd�}|�|�|�t|�d|jj�d��|�
|��|�dd�}|j|jd�}	|	�t�|t�}
|�t|	�d|jjd|
�|	��|�t|	�d|jj�d��|j|jd�}|�t�|�t�|t�}|t�}
|�t|�d|jjd||
f�|j|jd�}|�t�xtd�D]}|�t��q>W|�t�d||
f}|�t|�d|jjd|�|��|�t|�d|jj�d��dS)NT)r"����<z pending created at r�:r3�>Fz	 pending>z cancelled>�z finished result=4>z# finished exception=RuntimeError()>cSs(t�|�\}}d|j||f}t�|�S)Nz
%s() at %s:%s)�
test_utilsZget_function_sourcer�re�escape)�func�filename�lineno�textrrr�	func_repr)sz3BaseFutureTests.test_future_repr.<locals>.func_reprz pending cb=\[%s\]>z pending cb=\[%s, %s\]>�z%s, <8 more>, %s)r"�	set_debugr0�_source_tracebackrQrKr-rrrrrFrr:rrIr	�assertRegexr
r�range)rZf_pending_debug�frameZ	f_pending�f_cancelledZf_resultrU�f_exceptionrmZf_one_callbacksZ	fake_reprZf_two_callbacksZ
first_reprZ	last_reprZf_many_callbacks�iZcb_regexrrr�test_future_repr	sp
&









z BaseFutureTests.test_future_reprcCs�ddlm}|j|jd�}|�d�|j|jd�}|||�|�|���|�|��d�|j|jd�}|�	t
��|j|jd�}|||�|�|���|�t
|j�|j|jd�}|��|j|jd�}|||�|�|�
��dS)Nr)�_copy_future_state)r"�
)Zasyncio.futuresrxr0r"rr6r
rQrrrFr?rr)rrxrZnewfruZnewf_exceptionrtZnewf_cancelledrrr�test_copy_stateNs$



zBaseFutureTests.test_copy_statec	sP|j|jd���fdd���fdd�}|�td��|�WdQRX���dS)N)r"c3s�EdHdS)Nrr)rNrr�coroksz'BaseFutureTests.test_iter.<locals>.corocs��\}}dS)Nr)Zarg1Zarg2)r{rr�testnsz'BaseFutureTests.test_iter.<locals>.testzawait wasn't used)r0r"rSrFr)rr|r)r{rNr�	test_iterhszBaseFutureTests.test_iterc	Cs0|j|jd�}|�td��d|_WdQRXdS)N)r"zcan only be set to FalseT)r0r"rS�
ValueError�_log_traceback)rrNrrr�test_log_tracebackusz"BaseFutureTests.test_log_tracebackzasyncio.base_events.loggercCs"|j|jd�}~|�|jj�dS)N)r")r0r"r4�error�called)r�m_logrNrrr�test_tb_logger_abandonedzsz(BaseFutureTests.test_tb_logger_abandonedcCs6|j|jd�}|�t��|��~|�|jj�dS)N)r")r0r"rrHrr4r�r�)rr�rNrrr�&test_tb_logger_not_called_after_cancel�s
z6BaseFutureTests.test_tb_logger_not_called_after_cancelcCs,|j|jd�}|�d�~|�|jj�dS)N)r"r>)r0r"rr4r�r�)rr�rNrrr�!test_tb_logger_result_unretrieved�s
z1BaseFutureTests.test_tb_logger_result_unretrievedcCs4|j|jd�}|�d�|��~|�|jj�dS)N)r"r>)r0r"rrr4r�r�)rr�rNrrr�test_tb_logger_result_retrieved�s

z/BaseFutureTests.test_tb_logger_result_retrievedcCsD|j|jd�}|�td��~t�|j�t��|�|j	j
�dS)N)r"�boom)r0r"rrFrf�run_brieflyr�
gc_collectr6r�r�)rr�rNrrr�$test_tb_logger_exception_unretrieved�sz4BaseFutureTests.test_tb_logger_exception_unretrievedcCs8|j|jd�}|�td��|��~|�|jj�dS)N)r"r�)r0r"rrFrr4r�r�)rr�rNrrr�"test_tb_logger_exception_retrieved�s
z2BaseFutureTests.test_tb_logger_exception_retrievedcCs>|j|jd�}|�td��|�t|j�~|�|jj�dS)N)r"r�)	r0r"rrFr?rr4r�r�)rr�rNrrr�)test_tb_logger_exception_result_retrieved�s
z9BaseFutureTests.test_tb_logger_exception_result_retrievedcCs|dd�}tj�d�}|�|d�}tj||jd�}|j�|�\}}|�t�	|��|�
|d�|�|t�
��|jdd�dS)NcSs|t��fS)N)�	threading�	get_ident)�argrrr�run�sz-BaseFutureTests.test_wrap_future.<locals>.runr3�oi)r"T)�wait)�
concurrentr�ThreadPoolExecutor�submitr&r'r"Zrun_until_completer6r5rQZassertNotEqualr�r��shutdown)rr��ex�f1�f2ZresZidentrrrr)�sz BaseFutureTests.test_wrap_futurecCs(|j|jd�}t�|�}|�||�dS)N)r")r0r"r&r'r:)rr�r�rrr�test_wrap_future_future�s
z'BaseFutureTests.test_wrap_future_futurec	snt�d��Z}�fdd�|_dd�}tj�d�}|�|d�}t�|�}��	�j
|j�|jdd	�WdQRXdS)
Nzasyncio.futures.eventscs�jS)N)r"r)rrrrB�rCzBBaseFutureTests.test_wrap_future_use_global_loop.<locals>.<lambda>cSs|t��fS)N)r�r�)r�rrrr��sz=BaseFutureTests.test_wrap_future_use_global_loop.<locals>.runr3r�T)r�)
r�patchZget_event_loopr�rr�r�r&r'r:r"r;r�)rZeventsr�r�r�r�r)rr� test_wrap_future_use_global_loop�s
z0BaseFutureTests.test_wrap_future_use_global_loopcCsNtj��}tj||jd�}|��t�|j�|�	|�
��|�	|�
��dS)N)r")r�r�Futurer&r'r"rrfr�r6r)rr�r�rrr�test_wrap_future_cancel�s
z'BaseFutureTests.test_wrap_future_cancelcCshtj��}tj||jd�}|�d�|��t�	|j�|�
|���|�|�
�d�|�|���dS)N)r"r>)r�rr�r&r'r"rrrfr�r4rrQrr6)rr�r�rrr�test_wrap_future_cancel2�s

z(BaseFutureTests.test_wrap_future_cancel2cCsZ|j�d�|j|jd�}t��jd}|�|jt�|�	|jddd�t
|df�dS)NT)r"r3�����test_future_source_traceback)r"ror0�sys�	_getframe�f_linenorWrp�listrQ�__file__)r�futurerkrrrr��sz,BaseFutureTests.test_future_source_tracebackc	Cs�|j�|�dd�}|�}|j|jd�}|�|�d}t�|j�t��tj	dkr�d|j
j�d�}t|�||j
f}|jjtj|d�nd}|jjtjd	d�|jjd
d
}|�|t�|tj��dS)Nc
Ss2y
t��Wn"tk
r,}z|Sd}~XYnXdS)N)�MemoryError�
BaseException)rUrrr�memory_error�s
zLBaseFutureTests.check_future_exception_never_retrieved.<locals>.memory_error)r")r�re�^z exception was never retrieved
)�exc_infoz,^Future/Task exception was never retrieved\nFr)r"ror0rrfr�rr�r��version_infor-rr7�
__traceback__r�Zassert_called_once_withr�ANY�	call_argsrqrg�compile�DOTALL)	r�debugr�r�rUr�Zregexr��messagerrr�&check_future_exception_never_retrieved�s 

z6BaseFutureTests.check_future_exception_never_retrievedcCs|�d�dS)NF)r�)rrrr�%test_future_exception_never_retrievedsz5BaseFutureTests.test_future_exception_never_retrievedcCs|�d�dS)NT)r�)rrrr�+test_future_exception_never_retrieved_debugsz;BaseFutureTests.test_future_exception_never_retrieved_debugcCs4|j|jd�}|��t�|d�|�|���dS)N)r"�)r0r"rrZ_set_result_unless_cancelledr6r)rrNrrr� test_set_result_unless_cancelledsz0BaseFutureTests.test_set_result_unless_cancelledc
Csz|j|jd�}|�d�|��}d}y|�d�Wn,tk
r^}z|jd}Wdd}~XYnX|�d�|�|d�dS)N)r")r3r�rzStopIteration was expected)	r0r"rr�sendrTr.ZfailrQ)rrN�firr�rrr�test_future_stop_iteration_argss

z/BaseFutureTests.test_future_stop_iteration_argscCs\|j|jd�}t|�}|�t|jttd�d�|�t|jtd�td��|�t|jt�dS)N)r"Zelephant� )r0r"rMr?r@�throwrHr�)rrNr�rrr�test_future_iter_throws

z&BaseFutureTests.test_future_iter_throwcCs>Gdd�d�}x*td�D]}|j|jd�}|�|��qWdS)Nc@seZdZdd�ZdS)z5BaseFutureTests.test_future_del_collect.<locals>.EvilcSst��dS)N)�gcZcollect)rrrr�__del__)sz=BaseFutureTests.test_future_del_collect.<locals>.Evil.__del__N)rrrr�rrrr�Evil(sr��d)r")rrr0r"r)rr�rvrNrrr�test_future_del_collect'sz'BaseFutureTests.test_future_del_collect)*rrrr0r r8r9r=rArOrPrRrVrXr`rwrzr}r�rr�r�r�r�r�r�r�r�r)r�r�r�r�r�r�r�r�r�r�r�r�r+rr)r%rr,bsH4
E
	


	r,�_CFuturezrequires the C _asyncio modulec@s8eZdZy
ejZWnek
r*dZYnXdd�ZdS)�CFutureTestsNc	CsF|j|jd�}|�t��
|`WdQRX|�t��
|`WdQRXdS)N)r")r0r"r?rGrr)rrNrrr�test_future_del_segfault9s
z%CFutureTests.test_future_del_segfault)rrrrr�r-rGr�rrrrr�1s


r�c@s@eZdZyGdd�dej�ZeZWnek
r:dZYnXdS)�CSubFutureTestsc@seZdZdS)zCSubFutureTests.CSubFutureN)rrrrrrr�
CSubFutureEsr�N)rrrrr�r�r-rGrrrrr�As
r�c@seZdZejZdS)�
PyFutureTestsN)rrrr�	_PyFuturer-rrrrr�Msr�cs|eZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Z�ZS)�BaseFutureDoneCallbackTestscst���|��|_dS)N)rr r!r")r)r%rrr Ss
z!BaseFutureDoneCallbackTests.setUpcCst�|j�dS)N)rfr�r")rrrrr�Wsz'BaseFutureDoneCallbackTests.run_brieflycs��fdd�}|S)Ncs����dS)N)�append)r�)�bag�thingrr�bag_appender\sz@BaseFutureDoneCallbackTests._make_callback.<locals>.bag_appenderr)rr�r�r�r)r�r�r�_make_callbackZsz*BaseFutureDoneCallbackTests._make_callbackcCst�dS)N)�NotImplementedError)rrrrr0`sz'BaseFutureDoneCallbackTests._new_futurecCs�g}|��}|�|d�}|�|d�}|�|d�}|�|�|�|�|�|�|�|�|�|�|�|g�|�d�|��|�|ddg�|�|��d�dS)Nr>�r��foo)r0r�rIrJrQrr�r)rr�r�cb1�cb2�cb3rrr�$test_callbacks_remove_first_callbackcs





z@BaseFutureDoneCallbackTests.test_callbacks_remove_first_callbackcCs�g}|��}|�|d�}|�|d�}|�|d�}|�|�|�|�|�|�|�|�|�|�|�|�|�|g�|�d�|��|�|dg�|�|��d�dS)Nr>r�r�r�)r0r�rIrJrQrr�r)rr�rr�r�r�rrr�/test_callbacks_remove_first_and_second_callbackzs 






zKBaseFutureDoneCallbackTests.test_callbacks_remove_first_and_second_callbackcCs�g}|��}|�|d�}|�|d�}|�|d�}|�|�|�|�|�|�|�|�|�|�|�|g�|�d�|��|�|ddg�|�|��d�dS)Nr>r�r�r�)r0r�rIrJrQrr�r)rr�rr�r�r�rrr�$test_callbacks_remove_third_callback�s





z@BaseFutureDoneCallbackTests.test_callbacks_remove_third_callbackcCsrg}|��}|�|�|d��|�|�|d��|�|g�|�d�|��|�|ddg�|�|��d�dS)Nr>r�r�)r0rIr�rQrr�r)rr�rrrr�$test_callbacks_invoked_on_set_result�s
z@BaseFutureDoneCallbackTests.test_callbacks_invoked_on_set_resultcCsdg}|��}|�|�|d��|�|g�t�}|�|�|��|�|dg�|�|��|�dS)Nr�)r0rIr�rQrFrr�r)rr�rrUrrr�'test_callbacks_invoked_on_set_exception�s
zCBaseFutureDoneCallbackTests.test_callbacks_invoked_on_set_exceptioncCs�g}|��}|�|d�}|�|d�}|�|d�}|�|�|�|�|�|�|�d�|�|�|�d�|�|�xtd�D]}|�|�q|W|�|�|�d�|�|g�|�d�|��|�|dg�|�|��d�dS)Nr3r�r�r��r�)	r0r�rIrQrJrrrr�r)rr�rr�r�r�rvrrr�test_remove_done_callback�s$



z5BaseFutureDoneCallbackTests.test_remove_done_callbackcsP|�����t�xtd�D]}��t�qWG�fdd�d�}��|��dS)N�?cseZdZ�fdd�ZdS)zRBaseFutureDoneCallbackTests.test_remove_done_callbacks_list_mutation.<locals>.evilcs��t�dS)NF)rJ�id)r�other)rNrr�__eq__�s
zYBaseFutureDoneCallbackTests.test_remove_done_callbacks_list_mutation.<locals>.evil.__eq__N)rrrr�r)rNrr�evil�sr�)r0rI�strrrr�rJ)r�_r�r)rNr�(test_remove_done_callbacks_list_mutation�s
zDBaseFutureDoneCallbackTests.test_remove_done_callbacks_list_mutationcCsHdd�}|��}|�|�|�t�|�t�|�d�t�|j�dS)NcSs|�t�dS)N)rJr�)rrrr�mut�szPBaseFutureDoneCallbackTests.test_schedule_callbacks_list_mutation_1.<locals>.mutr3)r0rIr�rrfr�r")rr�rNrrr�'test_schedule_callbacks_list_mutation_1�s



zCBaseFutureDoneCallbackTests.test_schedule_callbacks_list_mutation_1cs\|�����t�xtd�D]}��t�qWd�d�G���fdd�d�}��|��dS)Nr�r�rcseZdZ���fdd�ZdS)zQBaseFutureDoneCallbackTests.test_schedule_callbacks_list_mutation_2.<locals>.evilcs�d7���kr��t�dS)Nr3F)rIr�)rr�)�	extra_cbsrN�
max_extra_cbsrrr�s
zXBaseFutureDoneCallbackTests.test_schedule_callbacks_list_mutation_2.<locals>.evil.__eq__N)rrrr�r)r�rNr�rrr�sr�)r0rIr�rrr�rJ)rr�r�r)r�rNr�r�'test_schedule_callbacks_list_mutation_2s
zCBaseFutureDoneCallbackTests.test_schedule_callbacks_list_mutation_2)rrrr r�r�r0r�r�r�r�r�r�r�r�r�r+rr)r%rr�Qs!
r�c@seZdZdd�ZdS)�CFutureDoneCallbackTestscCstj|jd�S)N)r")rr�r")rrrrr0sz$CFutureDoneCallbackTests._new_futureN)rrrr0rrrrr�sr�c@seZdZdd�ZdS)�CSubFutureDoneCallbackTestscCsGdd�dtj�}||jd�S)Nc@seZdZdS)z;CSubFutureDoneCallbackTests._new_future.<locals>.CSubFutureN)rrrrrrrr�)sr�)r")rr�r")rr�rrrr0(sz'CSubFutureDoneCallbackTests._new_futureN)rrrr0rrrrr�#sr�c@seZdZdd�ZdS)�PyFutureDoneCallbackTestscCstj|jd�S)N)r")rr�r")rrrrr01sz%PyFutureDoneCallbackTests._new_futureN)rrrr0rrrrr�.sr�cs,eZdZdd�Z�fdd�Zdd�Z�ZS)�BaseFutureInheritanceTestscCst�dS)N)r�)rrrr�_get_future_cls7sz*BaseFutureInheritanceTests._get_future_clscs&t���|��|_|�|jj�dS)N)rr r!r"r#r$)r)r%rrr :s

z BaseFutureInheritanceTests.setUpc	CsH|��}Gdd�d|�}||jd�}|�td��|��WdQRXdS)Nc@seZdZdd�ZdS)zQBaseFutureInheritanceTests.test_inherit_without_calling_super_init.<locals>.MyFutc_sdS)Nr)rr.r/rrrr1DszZBaseFutureInheritanceTests.test_inherit_without_calling_super_init.<locals>.MyFut.__init__N)rrrr1rrrr�MyFutCsr�)r"z!Future object is not initialized.)r�r"rSrFr<)rr-r�rNrrr�'test_inherit_without_calling_super_init?szBBaseFutureInheritanceTests.test_inherit_without_calling_super_init)rrrr�r r�r+rr)r%rr�5sr�c@seZdZdd�ZdS)�PyFutureInheritanceTestscCstjS)N)rr�)rrrrr�Rsz(PyFutureInheritanceTests._get_future_clsN)rrrr�rrrrr�Psr�c@seZdZdd�ZdS)�CFutureInheritanceTestscCstjS)N)rr�)rrrrr�Xsz'CFutureInheritanceTests._get_future_clsN)rrrr�rrrrr�Vsr��__main__)%�__doc__�concurrent.futuresr�r�rgr�r�Zunittestrr&rZtest.test_asynciorrfr|rr	r
rrZTestCaserr,Z
skipUnless�hasattrr�r�r�r�r�r�r�r�r�r�r�mainrrrr�<module>s\3R
J