403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/test/test_asyncio/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/test/test_asyncio/__pycache__/test_futures.cpython-312.pyc
�

���g����dZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlZddlmZddl
Z
ddlmZddlmZd�Zd	�Zd
�Zd�ZGd�d
e�ZGd�dej2j4�ZGd�d�ZGd�dej:�ZGd�d�Zej@e!ed�d�Gd�deej:��Z"ej@e!ed�d�Gd�deej:��Z#Gd�deej:�Z$Gd�d�Z%ej@e!ed�d�Gd �d!e%ej:��Z&ej@e!ed�d�Gd"�d#e%ej:��Z'Gd$�d%e%ej:�Z(Gd&�d'�Z)Gd(�d)e)ej:�Z*ej@e!ed�d�Gd*�d+e)ej:��Z+e,d,k(rejZ�yy)-zTests for futures.py.�N)�mock)�GenericAlias)�futures)�utils)�supportc�.�tjd�y�N)�asyncio�set_event_loop_policy���3C:\Python312\\Lib\test\test_asyncio\test_futures.py�tearDownModulers���!�!�$�'r
c��|Sr	r��fs r�	_fakefuncrs���Hr
c��yr	rrr
r�first_cbr���r
c��yr	rrr
r�last_cbrrr
c��eZdZdZy)�
ReachableCodez�Exception to raise to indicate that some code was reached.

    Use this exception if using mocks is not a good alternative.
    N)�__name__�
__module__�__qualname__�__doc__rr
rrr"s��r
rc��eZdZdZd�Zd�Zy)�SimpleEvilEventLoopzEBase class for UAF and other evil stuff requiring an evil event loop.c��y�NFr��selfs r�	get_debugzSimpleEvilEventLoop.get_debug,s��r
c�h�|j�s"|j�s|j�yyyr	)�	is_closed�
is_running�closer#s r�__del__zSimpleEvilEventLoop.__del__/s&���~�~�����(9��J�J�L�):�r
N)rrrrr%r*rr
rr r )s��O��r
r c�L�eZdZdZdZdZdZd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zy)�
DuckFutureFNc�4�|j�ryd|_y)NFT)�done�_DuckFuture__cancelledr#s r�cancelzDuckFuture.cancel>s���9�9�;�����r
c��|jSr	)r/r#s r�	cancelledzDuckFuture.cancelledDs�����r
c�Z�|jxs|jduxs|jduSr	)r/�_DuckFuture__result�_DuckFuture__exceptionr#s rr.zDuckFuture.doneGs4��� � �0��=�=��,�0��#�#�4�/�	1r
c��|j|j��|j�|j�|jSr	)�assertFalser2r5r4r#s r�resultzDuckFuture.resultLs9��������)�*����'��"�"�"��}�}�r
c�X�|j|j��|jSr	)r7r2r5r#s r�	exceptionzDuckFuture.exceptionRs#��������)�*����r
c�r�|j|j��|j|�||_yr	)r7r.�assertIsNotNoner4)r$r8s  r�
set_resultzDuckFuture.set_resultVs+���������%����V�$���
r
c�r�|j|j��|j|�||_yr	)r7r.r<r5)r$r:s  r�
set_exceptionzDuckFuture.set_exception[s,���������%����Y�'�$��r
c#�K�|j�sd|_|��|j|j��|j�S�w�NT)r.�_asyncio_future_blocking�
assertTruer8r#s r�__iter__zDuckFuture.__iter__`s:�����y�y�{�,0�D�)��J�����	�	��$��{�{�}��s�AA
)rrrrBr/r4r5r0r2r.r8r:r=r?rDrr
rr,r,5sA�� %���K��H��K�� �1�
� ��
%�
r
r,c�*��eZdZ�fd�Zd�Zd�Z�xZS)�	DuckTestsc���t�|��|j�|_|j	|jj
�yr	��super�setUp�
new_test_loop�loop�
addCleanupr)�r$�	__class__s �rrJzDuckTests.setUpj�0���
��
���&�&�(��	�����	�	���(r
c�f�t�}tj|�}|j||�yr	)r,r
�wrap_future�assertIs�r$r�gs   r�test_wrap_futurezDuckTests.test_wrap_futureos'���L������"���
�
�a��r
c�f�t�}tj|�}|j||�yr	)r,r
�
ensure_futurerSrTs   r�test_ensure_futurezDuckTests.test_ensure_futurets'���L���!�!�!�$���
�
�a��r
)rrrrJrVrY�
__classcell__�rOs@rrFrFhs���)�
�
r
rFc���eZdZd�Z�fd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zefd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zej8d�d��Zej8d�d��Zej8d�d��Zej8d�d��Z ej8d�d��Z!ej8d�d��Z"ej8d�d��Z#d �Z$d!�Z%d"�Z&d#�Z'd$�Z(d%�Z)d&�Z*d'�Z+ej8d�d(��Z,d)�Z-d*�Z.d+�Z/d,�Z0d-�Z1d.�Z2d/�Z3d0�Z4�xZ5S)1�BaseFutureTestsc�&�|j|i|��Sr	)�cls�r$�args�kwargss   r�_new_futurezBaseFutureTests._new_future|s���t�x�x��(��(�(r
c���t�|��|j�|_|j	|jj
�yr	rHrNs �rrJzBaseFutureTests.setUprPr
c��|jt}|j|jtf�|j	|t
�yr	)r_�str�assertEqual�__args__�assertIsInstancer)r$�futures  r�test_generic_aliasz"BaseFutureTests.test_generic_alias�s5�����#���������3�&�1����f�l�3r
c	���Gd�d�}|jtj|��|jtj|���|jtjd��|jtjt	j
���|j
|j��}|jtj|��|jtjt|���|jtjt	j
t|����|j�y)Nc��eZdZdZd�Zy)�/BaseFutureTests.test_isfuture.<locals>.MyFutureNc��d|_yr")rBr#s r�__init__z8BaseFutureTests.test_isfuture.<locals>.MyFuture.__init__�s
��05��-r
)rrrrBrprr
r�MyFuturern�s
��'+�$�
6r
rq��rL)
r7r
�isfuturerCr�MockrcrL�typer0)r$rqrs   r�
test_isfuturezBaseFutureTests.test_isfuture�s���	6�	6�	
����)�)�(�3�4�����(�(���4�5�����)�)�!�,�-�	
����)�)�$�)�)�+�6�7����$�)�)��,������(�(��+�,�����)�)�$�q�'�2�3�	
����(�(����4��7�);�<�=�	���
r
c��|j|j��}|j|j��|j|j	��|j�|j
|j��y�Nrs)rcrLr7r2r.r0rC�r$rs  r�test_initial_statez"BaseFutureTests.test_initial_state�s\�����$�)�)��,���������'��������"�	���
�������
�&r
c�z�|jtd�5|j�ddd�y#1swYyxYw)N�no current event loop)�assertRaisesRegex�RuntimeErrorrcr#s r�test_constructor_without_loopz-BaseFutureTests.test_constructor_without_loop�s,��
�
#�
#�L�2I�
J�����K�
J�
J�s�1�:c�����fd�}�jj|��}�j|j�j��j|j	��j�y)Nc��,�K��j�S�wr	)rcr#s�r�testz?BaseFutureTests.test_constructor_use_running_loop.<locals>.test�s������#�#�%�%�s�)rL�run_until_completerS�_loop�get_loop)r$r�rs`  r�!test_constructor_use_running_loopz1BaseFutureTests.test_constructor_use_running_loop�sL���	&��I�I�(�(���0���
�
�a�g�g�t�y�y�)��
�
�a�j�j�l�D�I�I�.r
c�B�tj|j�|jtjd�|j	�}|j|j|j�|j|j�|j�yr	)r
�set_event_looprLrMrcrSr�r�rzs  r� test_constructor_use_global_loopz0BaseFutureTests.test_constructor_use_global_loop�sd�����t�y�y�)�����.�.��5�������
�
�a�g�g�t�y�y�)��
�
�a�j�j�l�D�I�I�.r
c�F�|jt|jd�y)N�*)�assertRaises�	TypeErrorrcr#s r�test_constructor_positionalz+BaseFutureTests.test_constructor_positional�s�����)�T�%5�%5�r�:r
c��|jj|j|j��}|jtj
|j�|jj|j|j��}|jtj
|j�|jj|j|j��}|jttf�5|jd�ddd�|jj|j|j��}|jttf�5|jt�ddd�|jj|j|j��}|jttf�5|j�ddd�|jj|j|j��}|jttf�5|jd��ddd�|jj|j|j��}|jttf�5|jd��ddd�|jj|j|j��}	t!|�|jj|j|j��}	|j#�|jj|j|j��}	t%|�|jj|j|j��}|j'|j)��|j'|j+��y#1swY���xYw#1swY��vxYw#1swY��xYw#1swY���xYw#1swY��jxYw#ttf$rY��BwxYw#t$rY��wxYw#t$rY��wxYw)Nrsc��yr	rrs r�<lambda>z4BaseFutureTests.test_uninitialized.<locals>.<lambda>�s��Dr
c��yr	rrs rr�z4BaseFutureTests.test_uninitialized.<locals>.<lambda>�s��tr
)r_�__new__rLr�r
�InvalidStateErrorr8r:r�AttributeErrorr=r?�	Exceptionr0�add_done_callback�remove_done_callback�repr�	__await__�iterr7r2r.�r$�futs  r�test_uninitializedz"BaseFutureTests.test_uninitialized�s$���h�h���t�x�x�d�i�i��8�����'�3�3�S�Z�Z�@��h�h���t�x�x�d�i�i��8�����'�3�3�S�]�]�C��h�h���t�x�x�d�i�i��8��
�
�
��n�=�
>��N�N�4� �?��h�h���t�x�x�d�i�i��8��
�
�
��n�=�
>����i�(�?��h�h���t�x�x�d�i�i��8��
�
�
��n�=�
>��J�J�L�?��h�h���t�x�x�d�i�i��8��
�
�
��n�=�
>��!�!�.�1�?��h�h���t�x�x�d�i�i��8��
�
�
��n�=�
>��$�$�^�4�?��h�h���t�x�x�d�i�i��8��	���I��h�h���t�x�x�d�i�i��8��	��M�M�O��h�h���t�x�x�d�i�i��8��	���I��h�h���t�x�x�d�i�i��8���������)��������$�O?�
>��?�
>��?�
>��?�
>��?�
>���n�-�	��	���	��	���	��	�sr�O&�)O3�P�8P
�P�,P'�)P=�+Q
�&O0�3O=�P
�
P�P$�'P:�9P:�=	Q
�	Q
�
	Q�Qc��|j|j��}|jt|d��|j	|j
d�|j
d�|jtj�5|jj|�ddd�|j	|j
d�y#1swY�&xYw)Nrs�_cancel_message�
my message)rcrLrC�hasattrrgr�r0r�r
�CancelledErrorr�rzs  r�!test_future_cancel_message_getterz1BaseFutureTests.test_future_cancel_message_getter�s������$�)�)��,�������#4�5�6�����*�*�D�1�	�����
�
�
�w�5�5�
6��I�I�(�(��+�7�����*�*�L�9�7�
6�s�C�Cc�z�|j|j��}|jd�d|_|j	|jd�|jtj�5|jj|�ddd�|j	|jd�y#1swY�&xYw)Nrsr�zmy new message)	rcrLr0r�rgr�r
r�r�rzs  r�!test_future_cancel_message_setterz1BaseFutureTests.test_future_cancel_message_setter�s������$�)�)��,��	�����,�������*�*�,<�=��
�
�w�5�5�
6��I�I�(�(��+�7�����*�*�,<�=�7�
6�s�0B1�1B:c��|j|j��}|j|j��|j|j	��|j|j��|j
tj|j�|j
tj|j�|j
tj|jd�|j
tj|jd�|j|j��yry)rcrLrCr0r2r.r�r
r�r8r:r�r=r?r7rzs  r�test_cancelzBaseFutureTests.test_cancels������$�)�)��,��������
�#�������
�&��������!����'�0�0�!�(�(�;����'�0�0�!�+�+�>����'�3�3�Q�\�\�4�H����'�3�3�Q�_�_�d�K��������$r
c��|j|j��}|jtj|j
�|j
d�|j|j��|j|j��|j|j�d�|j|j�d�|jtj|jd�|jtj|jd�|j|j��y�Nrsr�)rcrLr�r
r�r8r=r7r2rCr.rgr:r?r0rzs  r�test_resultzBaseFutureTests.test_results������$�)�)��,�����'�3�3�Q�X�X�>�	���R���������'��������!��������R�(���������-����'�3�3�Q�\�\�4�H����'�3�3�Q�_�_�d�K��������$r
c��t�}|j|j��}|jtj
|j�|j|�|j|j��|j|j��|jt|j�|j|j
�|�|jtj
|jd�|jtj
|jd�|j|j��yry)rrcrLr�r
r�r:r?r7r2rCr.r8rgr=r0)r$�excrs   r�test_exceptionzBaseFutureTests.test_exceptions����n�����$�)�)��,�����'�3�3�Q�[�[�A�	������������'��������!����,����1���������,����'�3�3�Q�\�\�4�H����'�3�3�Q�_�_�d�K��������$r
c���|�}|j|j��}|j|�|j|j	��|j|j
��|jt|j�|j�}|j}|j|t�|jt|�d�|j||�y)Nrsz!StopIteration .* cannot be raised)rcrLr?r7r2rCr.r�rr8r:�	__cause__ri�assertRegexrf)r$�stop_iteration_classr�r�causes     r�test_stop_iteration_exceptionz-BaseFutureTests.test_stop_iteration_exception-s���"�$�����$�)�)��,��	������������'��������!����,����1��k�k�m���
�
�����c�<�0�����S��#F�G����e�%9�:r
c�D�Gd�dt�}|j|�y)Nc��eZdZy)�OBaseFutureTests.test_stop_iteration_subclass_exception.<locals>.MyStopIterationN�rrrrr
r�MyStopIterationr�;���r
r�)�
StopIterationr�)r$r�s  r�&test_stop_iteration_subclass_exceptionz6BaseFutureTests.test_stop_iteration_subclass_exception:s��	�m�	�	
�*�*�?�;r
c��|j|j��}|jt�|j	|j�t�yry)rcrLr?rrir:rzs  r�test_exception_classz$BaseFutureTests.test_exception_class@s;�����$�)�)��,��	����%����a�k�k�m�\�:r
c�P��|j|j����fd�}|�}|jt|�d�|jt|����j	d�|jt|�d�|jt|�d�y)Nrsc3�^�K�d���Ed{���}d|f���Ed{���}d|f��y7�7�
�w)N�A�B�Cr)�x�yrs  �r�fixturez6BaseFutureTests.test_yield_from_twice.<locals>.fixtureHs5������I���A��q�&�L���A��q�&�L����s�
-�)�-�+�-�-r�r�)r�r�)r�r�)rcrLrg�nextr=)r$r�rUrs   @r�test_yield_from_twicez%BaseFutureTests.test_yield_from_twiceEs�������$�)�)��,��	�
�I������a��#�&�����a��!�$�	���R������a��)�,�����a��)�,r
c
�x	�|jjd�|j|j��}|jd}|j	t|�d|jj�d|d�d|d�d	��|j�|jjd
�|j|j��}|j	t|�d|jj�d��|j�|j|j��}|j�|j	t|�d|jj�d��|j|j��}|jd
�|j	t|�d|jj�d��|j	|j�d
�t�}|j|j��}|j|�|j	t|�d|jj�d��|j|j�|�d�}|j|j��}	|	jt �|t �}
|j#t|	�d|jjzd|
zz�|	j�|j	t|	�d|jj�d��|j|j��}|jt$�|jt&�|t$�}|t&�}
|j#t|�d|jjzd|�d|
�d�z�|j|j��}|jt$�t)d�D]}|jt ��|jt&�|�d|
��}|j#t|�d|jjzd|zz�|j�|j	t|�d|jj�d��y)NTrs����<z pending created at r�:rr�>Fz	 pending>z cancelled>�z finished result=4>z# finished exception=RuntimeError()>c��tj|�\}}|j�d|�d|��}tj|�S)Nz() at r�)�
test_utils�get_function_sourcer�re�escape)�func�filename�lineno�texts    r�	func_reprz3BaseFutureTests.test_future_repr.<locals>.func_reprws7��)�=�=�d�C��H�f�&*�&7�&7��6�J�D��9�9�T�?�"r
z pending cb=\[%s\]>z pending cb=\[z, z\]>�z, <8 more>, )rL�	set_debugrc�_source_tracebackrgr�r_rr0r=r8rr?rSr:r�rr�rr�range)r$�f_pending_debug�frame�	f_pending�f_cancelled�f_resultr��f_exceptionr��f_one_callbacks�	fake_repr�f_two_callbacks�
first_repr�	last_repr�f_many_callbacks�i�cb_regexs                 r�test_future_reprz BaseFutureTests.test_future_reprWs���	�	���D�!��*�*��	�	�*�:���1�1�"�5�������!�����!�!�"�"6�u�Q�x�j��%��(��1�M�	O�	��� ��	�	���E�"��$�$�$�)�)�$�4�	�����i��A�d�h�h�.?�.?�-@�	�*J�K������&�&�D�I�I�&�6����������k�*�a����0A�0A�/B�+�,N�O��#�#����#�3�����A�������N�a���� 1� 1�2�2E�F�	H�������*�A�.��n���&�&�D�I�I�&�6���!�!�#�&�����������!�!�"�"E�F�	H�	
�
�
�k�+�+�-�s�3�	#�
�*�*��	�	�*�:���)�)�)�4��i�(�	������!��4�8�8�$�$�$�'=�	�'I�I�	K�	��� �����o�.��T�X�X�.�.�/�{�;�	=��*�*��	�	�*�:���)�)�(�3��)�)�'�2��x�(�
��g�&�	�����o�.����� 1� 1�1�&�	�53�3�	4� �+�+����+�;���*�*�8�4��q��A��.�.�y�9���*�*�7�3�*4�i�@������!�"��4�8�8�$�$�$�'=��'H�H�	J�	���!�����.�/��T�X�X�.�.�/�{�;�	=r
c�D�ddlm}|j|j��}|j	d�|j|j��}|||�|j|j
��|j|j�d�|j|j��}|jt��|j|j��}|||�|j|j
��|jt|j�|j|j��}|j�|j|j��}|||�|j|j��y)Nr)�_copy_future_staters�
)�asyncio.futuresr�rcrLr=rCr.rgr8r?rr�r0r2)r$r�r�newfr��newf_exceptionr��newf_cancelleds        r�test_copy_statezBaseFutureTests.test_copy_state�s=��6����$�)�)��,��	���R�����T�Y�Y��/���1�d�#�����	�	��$���������+��&�&�D�I�I�&�6���!�!�,�.�1��)�)�t�y�y�)�9���;��7�����+�+�-�.����,��(=�(=�>��&�&�D�I�I�&�6�������)�)�t�y�y�)�9���;��7�����0�0�2�3r
c�����|j|j����fd���fd�}|jtd�5|�ddd��j	�y#1swY�xYw)Nrsc3�&�K��Ed{���y7��wr	r�r�s�r�coroz'BaseFutureTests.test_iter.<locals>.coro�s������N�N�s���c�����\}}yr	r)�arg1�arg2r�s  �rr�z'BaseFutureTests.test_iter.<locals>.test�s�����J�D�$r
zawait wasn't used)rcrLr~rr0)r$r�r�r�s  @@r�	test_iterzBaseFutureTests.test_iter�sU������D�I�I��.��	�	 ��
#�
#�L�2E�
F��F�G��
�
��G�
F�s�A � A)c��|j|j��}|jtd�5d|_ddd�y#1swYyxYw)Nrszcan only be set to FalseT)rcrLr~�
ValueError�_log_tracebackr�s  r�test_log_tracebackz"BaseFutureTests.test_log_traceback�s?�����D�I�I��.��
�
#�
#�J�0J�
K�!%�C��L�
K�
K�s�A�A
zasyncio.base_events.loggerc��|j|j��}~|j|jj�yry)rcrLr7�error�called�r$�m_logr�s   r�test_tb_logger_abandonedz(BaseFutureTests.test_tb_logger_abandoned�s4�����D�I�I��.���������+�+�,r
c���|j|j��}|jt��|j	�~|j|jj�yry)rcrLr?r�r0r7rrrs   r�&test_tb_logger_not_called_after_cancelz6BaseFutureTests.test_tb_logger_not_called_after_cancel�sM�����D�I�I��.�����)�+�&��
�
���������+�+�,r
c��|j|j��}|jd�~|j|jj
�yr�)rcrLr=r7rrrs   r�!test_tb_logger_result_unretrievedz1BaseFutureTests.test_tb_logger_result_unretrieved�s@�����D�I�I��.�����r���������+�+�,r
c���|j|j��}|jd�|j�~|j	|j
j�yr�)rcrLr=r8r7rrrs   r�test_tb_logger_result_retrievedz/BaseFutureTests.test_tb_logger_result_retrieved�sI�����D�I�I��.�����r���
�
���������+�+�,r
c�"�|j|j��}|jtd��~t	j
|j�t
j�|j|jj�y�Nrs�boom)rcrLr?rr��run_brieflyr�
gc_collectrCrrrs   r�$test_tb_logger_exception_unretrievedz4BaseFutureTests.test_tb_logger_exception_unretrieved�sc�����D�I�I��.�����,�v�.�/�����t�y�y�)�����������*�*�+r
c���|j|j��}|jtd��|j	�~|j|jj�yr)rcrLr?rr:r7rrrs   r�"test_tb_logger_exception_retrievedz2BaseFutureTests.test_tb_logger_exception_retrieved�sP�����D�I�I��.�����,�v�.�/��
�
���������+�+�,r
c��|j|j��}|jtd��|j	t|j
�~|j
|jj�yr)	rcrLr?rr�r8r7rrrs   r�)test_tb_logger_exception_result_retrievedz9BaseFutureTests.test_tb_logger_exception_result_retrieved�s[�����D�I�I��.�����,�v�.�/����,��
�
�3��������+�+�,r
c���d�}tjjd�}|j|d�}t	j
||j��}|jj|�\}}|jt	j|��|j|d�|j|tj��|jd��y)Nc�.�|tj�fSr	��	threading�	get_ident��args r�runz-BaseFutureTests.test_wrap_future.<locals>.run�����,�,�.�/�/r
rr�oirsT��wait)�
concurrentr�ThreadPoolExecutor�submitr
rRrLr�rCrtrg�assertNotEqualrr�shutdown)r$r�ex�f1�f2�res�idents       rrVz BaseFutureTests.test_wrap_future�s���	0�
�
�
�
2�
2�1�
5��
�Y�Y�s�D�
!��
�
 �
 ��$�)�)�
4���Y�Y�1�1�"�5�
��U�����(�(��,�-�����d�#����E�9�#6�#6�#8�9�
�����r
c��|j|j��}tj|�}|j	||�yry)rcrLr
rRrS�r$r)r*s   r�test_wrap_future_futurez'BaseFutureTests.test_wrap_future_futures7��
�
�
�4�9�9�
�
-��
�
 �
 ��
$���
�
�b�"�r
c��d�}tjjd�}|j|d�}|j	t
d�5t
j|�ddd�|jd��y#1swY�xYw)Nc�.�|tj�fSr	rrs rrz:BaseFutureTests.test_wrap_future_without_loop.<locals>.runrr
rrr r}Tr!)	r#rr$r%r~rr
rRr')r$rr(r)s    r�test_wrap_future_without_loopz-BaseFutureTests.test_wrap_future_without_loopsj��	0�
�
�
�
2�
2�1�
5��
�Y�Y�s�D�
!��
�
#�
#�L�2I�
J�����#�K�
������K�
J�s�A<�<Bc�(��d�}tjjd�}|j|d���fd�}|jj|��}|j
|j|j�|jd��y)Nc�.�|tj�fSr	rrs rrz>BaseFutureTests.test_wrap_future_use_running_loop.<locals>.runrr
rrr c��6�K�tj��S�wr	)r
rR)r)s�rr�z?BaseFutureTests.test_wrap_future_use_running_loop.<locals>.tests������&�&�r�*�*�s�Tr!)	r#rr$r%rLr�rSr�r')r$rr(r�r*r)s     @r�!test_wrap_future_use_running_loopz1BaseFutureTests.test_wrap_future_use_running_loopsm���	0�
�
�
�
2�
2�1�
5��
�Y�Y�s�D�
!��	+�
�Y�Y�
)�
)�$�&�
1���
�
�d�i�i����*�
�����r
c��tj|j�|jtjd�d�}tj
j
d�}|j|d�}tj|�}|j|j|j�|jd��y)Nc�.�|tj�fSr	rrs rrz=BaseFutureTests.test_wrap_future_use_global_loop.<locals>.run(rr
rrr Tr!)r
r�rLrMr#rr$r%rRrSr�r')r$rr(r)r*s     r� test_wrap_future_use_global_loopz0BaseFutureTests.test_wrap_future_use_global_loop$s������t�y�y�)�����.�.��5�	0�
�
�
�
2�
2�1�
5��
�Y�Y�s�D�
!��
�
 �
 ��
$���
�
�d�i�i����*�
�����r
c�\�tjj�}tj||j
��}|j
�tj|j
�|j|j��|j|j��yry)r#r�Futurer
rRrLr0r�rrCr2r.s   r�test_wrap_future_cancelz'BaseFutureTests.test_wrap_future_cancel0sk��
�
�
�
&�
&�
(��
�
 �
 ��$�)�)�
4��
�	�	�����t�y�y�)��������'��������'r
c��tjj�}tj||j
��}|j
d�|j�tj|j
�|j|j��|j|j�d�|j|j��yr�)r#rr;r
rRrLr=r0r�rr7r2rgr8rCr.s   r�test_wrap_future_cancel2z(BaseFutureTests.test_wrap_future_cancel28s���
�
�
�
&�
&�
(��
�
 �
 ��$�)�)�
4��
�
�
�b��
�	�	�����t�y�y�)��������(��������b�)��������'r
c�F�|jjd�|j|j��}tj�j
dz
}|j
|jt�|j|jdddt|df�y)NTrsrr�����test_future_source_traceback)rLr�rc�sys�	_getframe�f_linenorir��listrg�__file__)r$rjr�s   rrBz,BaseFutureTests.test_future_source_tracebackBs����	�	���D�!��!�!�t�y�y�!�1������)�)�A�-�����f�6�6��=�����1�1�"�5�b�q�9�"� �8�:�	;r
c�l�|jj|�d�}|�}|j|j��}|j|�d}t	j
|j�t
j�d|jj�d�}t|�||jf}|jjtj|��|jj dd}|j#|t%j&|t$j(��y)Nc�H�	t��#t$r}|cYd}~Sd}~wwxYwr	)�MemoryError�
BaseException)r�s r�memory_errorzLBaseFutureTests.check_future_exception_never_retrieved.<locals>.memory_errorQs$��
�!�m�#�� �
��
��
�s�
�	!��!�!rs�^z exception was never retrieved
)�exc_infor)rLr�rcr?r�rrrr_rrv�
__traceback__r�assert_called_once_withr�ANY�	call_argsr�r��compile�DOTALL)	r$�debugrrLr�rj�regexrN�messages	         r�&check_future_exception_never_retrievedz6BaseFutureTests.check_future_exception_never_retrievedMs����	�	���E�"�	�
�n���!�!�t�y�y�!�1�����S�!������t�y�y�)������D�H�H�%�%�&�&F�G����I�s�C�$5�$5�6��
���+�+�D�H�H�x�+�H��+�+�'�'��*�1�-������"�*�*�U�B�I�I�">�?r
c�&�|jd�yr"�rXr#s r�%test_future_exception_never_retrievedz5BaseFutureTests.test_future_exception_never_retrievedes���3�3�E�:r
c�&�|jd�yrArZr#s r�+test_future_exception_never_retrieved_debugz;BaseFutureTests.test_future_exception_never_retrieved_debughs���3�3�D�9r
c���|j|j��}|j�tj|d�|j|j
��y)Nrs�)rcrLr0r�_set_result_unless_cancelledrCr2r�s  r� test_set_result_unless_cancelledz0BaseFutureTests.test_set_result_unless_cancelledksD�����D�I�I��.���
�
���,�,�S�!�4�����
�
��(r
c�6�|j|j��}|jd�|j�}d}	|j	d�|jd�|j|d�y#t$r}|jd}Yd}~�0d}~wwxYw)Nrs)rrr_zStopIteration was expectedr)	rcrLr=rD�send�failr�rarg)r$r��fir8r(s     r�test_future_stop_iteration_argsz/BaseFutureTests.test_future_stop_iteration_argsqs������D�I�I��.�����v��
�\�\�^����	4��G�G�D�M�
�I�I�2�3������(��	�	 ��W�W�Q�Z�F��	 �s�A6�6	B�?B�Bc	���|j|j��}t|�}|jt�5|jt|jtt
d�d�ddd�tj�5tjdt��|jt|jtt
d�d�|jt|jt
d�t
d��|jt|jtdd�ddd�|jt|jt�y#1swY��xYw#1swY�;xYw)Nrs�zebra�ignore)�category�elephant� )rcrLr��assertWarns�DeprecationWarningr�r��throw�warnings�catch_warnings�filterwarningsr�r�rF)r$r�res   r�test_future_iter_throwz&BaseFutureTests.test_future_iter_throw~s�����D�I�I��.��
�#�Y��
�
�
�0�
1����i����9�i��>P�RV�W�2�
�
$�
$�
&��#�#�H�7I�J����i����%�y��'<�b�
B����i����%�j�1�9�Z�3H�
J�
���j�"�(�(�J��d�K�'�	
���)�R�X�X�t�4�2�
1��
&�
&�s�1E�
B'E+�E(�+E4c��Gd�d�}td�D]4}|j|j��}|j|���6y)Nc��eZdZd�Zy)�5BaseFutureTests.test_future_del_collect.<locals>.Evilc�,�tj�yr	)�gc�collectr#s rr*z=BaseFutureTests.test_future_del_collect.<locals>.Evil.__del__�s���
�
�r
N)rrrr*rr
r�Evilrv�s��
r
rz�drs)r�rcrLr=)r$rzr�r�s    r�test_future_del_collectz'BaseFutureTests.test_future_del_collect�sA��	�	��s��A��"�"��	�	�"�2�C��N�N�4�6�"�r
c�2�|j|j��}|j�d}	|j�|j
|�|jtj|�g�y#tj
$r}|}Yd}~�Qd}~wwxYwry)
rcrLr0r8r
r�r<�assertListEqualrx�
get_referrers�r$rr��es    r�&test_future_cancelled_result_refcyclesz6BaseFutureTests.test_future_cancelled_result_refcycles�s}�����$�)�)��,��	���
���	�
�H�H�J�	
���S�!����R�-�-�c�2�B�7���%�%�	��C��	���A7�7B�
B�Bc�2�|j|j��}|j�d}	|j�|j
|�|jtj|�g�y#tj
$r}|}Yd}~�Qd}~wwxYwry)
rcrLr0r:r
r�r<r~rxrr�s    r�)test_future_cancelled_exception_refcyclesz9BaseFutureTests.test_future_cancelled_exception_refcycles�s}�����$�)�)��,��	���
���	�
�K�K�M�	
���S�!����R�-�-�c�2�B�7���%�%�	��C��	�r�)6rrrrcrJrkrwr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�patchrrr
rrrrrVr/r2r6r9r<r>rBrXr[r]rarfrsr|r�r�rZr[s@rr]r]zs����)�)�
4�
�.'��/�/�;�2%�h:�	>�	%�%�%�BO�;�<�;�
-�$C=�J4�4�&�
�T�Z�Z�,�-�-�.�-�
�T�Z�Z�,�-�-�.�-��T�Z�Z�,�-�-�.�-��T�Z�Z�,�-�-�.�-��T�Z�Z�,�-�,�.�,��T�Z�Z�,�-�-�.�-��T�Z�Z�,�-�-�.�-���
�	�
�(�(�	;��T�Z�Z�,�-�@�.�@�.;�:�)�)�
5�#�	8�	8r
r]�_CFuturezrequires the C _asyncio modulec�R�eZdZ	ejZd�Zd�Zd�Z	y#e$rdZY�wxYw)�CFutureTestsNc���|j|j��}|jt�5|`ddd�|jt�5|`ddd�y#1swY�*xYw#1swYyxYwry)rcrLr�r�rBr�r�s  r�test_future_del_segfaultz%CFutureTests.test_future_del_segfault�s^�����D�I�I��.��
�
�
�~�
.��,�/�
�
�
�~�
.��"�/�
.�/�
.��
.�
.�s�A�A*�A'�*A3c��ddl}t|j|j���}~t	j
|�}t	j�y)Nrrs)�_asyncior�rcrLrx�
get_referentsry)r$r��it�evils    r�'test_future_iter_get_referents_segfaultz4CFutureTests.test_future_iter_get_referents_segfault�s=���
�$�"�"��	�	�"�2�
3�������)��
�
�
�r
c��|j|j��}d�}d�}|j|�|j|�|j}|j	||j�|j|�|j}|j	||j�|j|�|j
|j�y)Nrsc��y)Nrrr��_s rr�z2CFutureTests.test_callbacks_copy.<locals>.<lambda>����qr
c��y)Nr_rr�s rr�z2CFutureTests.test_callbacks_copy.<locals>.<lambda>�r�r
)rcrLr��
_callbacks�assertIsNotr��assertIsNone)r$r�r)r*�	callbackss     r�test_callbacks_copyz CFutureTests.test_callbacks_copy�s���
���D�I�I��.��
��
�����b�!����b�!��N�N�	�����C�N�N�3�� � ��$��N�N�	�����C�N�N�3�� � ��$����#�.�.�)r
)
rrrrr�r_r�r�r�r�rr
rr�r��s7�������#��*��%�����s��&�&r�c�V�eZdZ	Gd�dej�ZeZy#e$rdZYywxYw)�CSubFutureTestsc��eZdZy)�CSubFutureTests.CSubFutureNr�rr
r�
CSubFuturer��r�r
r�N)rrrrr�r�r_r�rr
rr�r��s4���	��)�)�	���������s��(�(r�c�$�eZdZejZy)�
PyFutureTestsN)rrrr�	_PyFuturer_rr
rr�r��s
��
�
�
�Cr
r�c���eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Z�xZS)�BaseFutureDoneCallbackTestsc�L��t�|��|j�|_yr	)rIrJrKrLrNs �rrJz!BaseFutureDoneCallbackTests.setUp�s���
��
���&�&�(��	r
c�B�tj|j�yr	)r�rrLr#s rrz'BaseFutureDoneCallbackTests.run_briefly�s�����t�y�y�)r
c������fd�}|S)Nc�(���j��yr	)�append)rj�bag�things ��r�bag_appenderz@BaseFutureDoneCallbackTests._make_callback.<locals>.bag_appender�s����J�J�u�r
r)r$r�r�r�s `` r�_make_callbackz*BaseFutureDoneCallbackTests._make_callback�s���	��r
c��t�r	��NotImplementedErrorr#s rrcz'BaseFutureDoneCallbackTests._new_future����!�!r
c��g}|j�}|j|d�}|j|d�}|j|d�}|j|�|j|�|j|�|j|�|j|�|j	|g�|jd�|j
�|j	|ddg�|j	|j�d�y�Nr��r{�foo�rcr�r�r�rgr=rr8�r$r�r�cb1�cb2�cb3s      r�$test_callbacks_remove_first_callbackz@BaseFutureDoneCallbackTests.test_callbacks_remove_first_callback�s�����������!�!�#�r�*���!�!�#�r�*���!�!�#�s�+��	���C� �	���C� �	���C� �	���s�#�	���s�#�����b�!�	���U����������r�3�i�(��������U�+r
c�,�g}|j�}|j|d�}|j|d�}|j|d�}|j|�|j|�|j|�|j|�|j|�|j|�|j	|g�|jd�|j
�|j	|dg�|j	|j�d�yr�r�r�s      r�/test_callbacks_remove_first_and_second_callbackzKBaseFutureDoneCallbackTests.test_callbacks_remove_first_and_second_callbacks�����������!�!�#�r�*���!�!�#�r�*���!�!�#�s�+��	���C� �	���C� �	���C� �	���s�#�	���s�#�	���s�#�����b�!�	���U����������s�e�$��������U�+r
c��g}|j�}|j|d�}|j|d�}|j|d�}|j|�|j|�|j|�|j|�|j|�|j	|g�|jd�|j
�|j	|ddg�|j	|j�d�yr�r�r�s      r�$test_callbacks_remove_third_callbackz@BaseFutureDoneCallbackTests.test_callbacks_remove_third_callback(s�����������!�!�#�r�*���!�!�#�r�*���!�!�#�s�+��	���C� �	���C� �	���C� �	���s�#�	���s�#�����b�!�	���U����������r�2�h�'��������U�+r
c�z�g}|j�}|j|j|d��|j|j|d��|j|g�|j	d�|j�|j|ddg�|j|j
�d�y)Nr�r�r�)rcr�r�rgr=rr8)r$r�rs   r�$test_callbacks_invoked_on_set_resultz@BaseFutureDoneCallbackTests.test_callbacks_invoked_on_set_result?s����������	���D�/�/��R�8�9�	���D�/�/��R�8�9�����b�!�	���U����������r�2�h�'��������U�+r
c�J�g}|j�}|j|j|d��|j|g�t	�}|j|�|j
�|j|dg�|j|j�|�y)Nr{)rcr�r�rgrr?rr:)r$r�rr�s    r�'test_callbacks_invoked_on_set_exceptionzCBaseFutureDoneCallbackTests.test_callbacks_invoked_on_set_exceptionMs����������	���D�/�/��S�9�:�����b�!��n��	�������������s�e�$���������,r
c���g}|j�}|j|d�}|j|d�}|j|d�}|j|�|j|�|j|j	|�d�|j|j	|�d�|j|�td�D]}|j|��|j|j	|�d�|j|g�|j
d�|j�|j|dg�|j|j�d�y)Nrrr_rAr��r�)	rcr�r�rgr�r�r=rr8)r$r�rr�r�r�r�s       r�test_remove_done_callbackz5BaseFutureDoneCallbackTests.test_remove_done_callback[s<����������!�!�#�q�)���!�!�#�q�)���!�!�#�q�)��	
���C� �	���C� �	
����/�/��4�a�8�	
����/�/��4�a�8�	
���C� ��q��A�
����$��	
����/�/��4�a�8�����b�!�	���U����������q�c�"��������U�+r
c����|j���jt�td�D]}�jt��G�fd�d�}�j|��y)N�?c���eZdZ�fd�Zy)�RBaseFutureDoneCallbackTests.test_remove_done_callbacks_list_mutation.<locals>.evilc�0���jt�yr")r��id�r$�otherr�s  �r�__eq__zYBaseFutureDoneCallbackTests.test_remove_done_callbacks_list_mutation.<locals>.evil.__eq__�s����(�(��,�r
N�rrrr�r�s�rr�r��s���
r
r��rcr�rfr�r�r��r$r�r�r�s   @r�(test_remove_done_callbacks_list_mutationzDBaseFutureDoneCallbackTests.test_remove_done_callbacks_list_mutation|sY������ �����c�"��r��A��!�!�"�%��	�	�
	� � ���(r
c����|j���jt�td�D]}�jt��G�fd�d�}�j|��y)Nr�c���eZdZ�fd�Zy)�OBaseFutureDoneCallbackTests.test_remove_done_callbacks_list_clear.<locals>.evilc�(���j|�yr	)r�r�s  �rr�zVBaseFutureDoneCallbackTests.test_remove_done_callbacks_list_clear.<locals>.evil.__eq__�s����(�(��/r
Nr�r�s�rr�r��s���
0r
r�r�r�s   @r�%test_remove_done_callbacks_list_clearzABaseFutureDoneCallbackTests.test_remove_done_callbacks_list_clear�sY������ �����c�"��r��A��!�!�"�%��	0�	0�	� � ���(r
c��d�}|j�}|j|�|jt�|jt�|jd�t	j
|j�y)Nc�.�|jt�yr	)r�rfrs r�mutzPBaseFutureDoneCallbackTests.test_schedule_callbacks_list_mutation_1.<locals>.mut�s��
�"�"�3�'r
rr)rcr�rfr=r�rrL)r$r�r�s   r�'test_schedule_callbacks_list_mutation_1zCBaseFutureDoneCallbackTests.test_schedule_callbacks_list_mutation_1�s_��	(���� �����c�"����c�"����c�"����q�����t�y�y�)r
c������|j���jt�td�D]}�jt��d�d�G���fd�d�}�j|��y)Nr�r{rc���eZdZ���fd�Zy)�QBaseFutureDoneCallbackTests.test_schedule_callbacks_list_mutation_2.<locals>.evilc�D���dz
���kr�jt�y)NrrF)r�r�)r$r��	extra_cbsr��
max_extra_cbss  ���rr�zXBaseFutureDoneCallbackTests.test_schedule_callbacks_list_mutation_2.<locals>.evil.__eq__�s%����Q��	��}�,��)�)�"�-�r
Nr�)r�r�r�s���rr�r��s���
r
r�r�)r$r�r�r�r�r�s   @@@r�'test_schedule_callbacks_list_mutation_2zCBaseFutureDoneCallbackTests.test_schedule_callbacks_list_mutation_2�se������ �����c�"��r��A��!�!�"�%���
��	�	�	�	� � ���(r
c�����d�d�����fd�}t�}||_tjj	|d|�5|j��|j
�j�|��jt��jt��j���j���jd�|j�jdgf�ddd�y#1swYyxYw)NFc��y�N.rrr
rr�zOBaseFutureDoneCallbackTests.test_evil_call_soon_list_mutation.<locals>.<lambda>�s��cr
c�\���r'�jt��j��yd�yrA)r��int)rarb�called_on_fut_callback0r��pads  ���r�evil_call_soonzUBaseFutureDoneCallbackTests.test_evil_call_soon_list_mutation.<locals>.evil_call_soon�s*���&��(�(��-��(�(��-�*.�'r
rLr)r �	call_soonrr��objectrcrSr�r�rfr�r=�assertInr�)r$r��fake_event_loopr�r�r�s   @@@r�!test_evil_call_soon_list_mutationz=BaseFutureDoneCallbackTests.test_evil_call_soon_list_mutation�s����"'����	/�.�/��$2��!�
�Z�Z�
�
�t�V�_�
=��"�"�$�C��M�M�#�,�,�.�/�:��!�!�#�&��!�!�#�&��!�!�#�&��!�!�#�&��N�N�6�"�
�M�M�#�.�.�4��*�5�>�
=�
=�s
�B,C7�7Dc���|j��Gd�d�}G�fd�d|�}�j|���j|��y)Nc��eZdZd�Zy)�aBaseFutureDoneCallbackTests.test_use_after_free_on_fut_callback_0_with_evil__eq__.<locals>.cb_padc��yrAr)r$r�s  rr�zhBaseFutureDoneCallbackTests.test_use_after_free_on_fut_callback_0_with_evil__eq__.<locals>.cb_pad.__eq__�s��r
Nr�rr
r�cb_padr��s��
r
r�c���eZdZ�fd�Zy)�_BaseFutureDoneCallbackTests.test_use_after_free_on_fut_callback_0_with_evil__eq__.<locals>.evilc�2���jd�tSr	)r��NotImplementedr�s  �rr�zfBaseFutureDoneCallbackTests.test_use_after_free_on_fut_callback_0_with_evil__eq__.<locals>.evil.__eq__�s����(�(��.�%�%r
Nr�r�s�rr�r��s���
&r
r�)rcr�r�)r$r�r�r�s   @r�5test_use_after_free_on_fut_callback_0_with_evil__eq__zQBaseFutureDoneCallbackTests.test_use_after_free_on_fut_callback_0_with_evil__eq__�sK������ ��	�	�	&�6�	&�
	���f�h�'�� � ���(r
c�p���G��fd�dt�}|�}tjj|d|�5|j	��|j�j
�|�d���j��|jt�jd�ddd�y#1swYyxYw)Nc�,���eZdZ�fd�Z��fd�Z�xZS)�rBaseFutureDoneCallbackTests.test_use_after_free_on_fut_callback_0_with_evil__getattribute__.<locals>.EvilEventLoopc�.��t�|�|i|��t�r	�rIr�r�r$rarbrOs   �rr�z|BaseFutureDoneCallbackTests.test_use_after_free_on_fut_callback_0_with_evil__getattribute__.<locals>.EvilEventLoop.call_soon�������!�4�2�6�2�#�#r
c�^��|dk(r�j���tj||�S)Nr�)r�r��__getattribute__)r$�namer��fut_callback_0s  ��rrz�BaseFutureDoneCallbackTests.test_use_after_free_on_fut_callback_0_with_evil__getattribute__.<locals>.EvilEventLoop.__getattribute__�s/����;�&��,�,�^�<�&��.�.�t�T�:�:r
�rrrr�rrZ)rOr�rs@��r�
EvilEventLoopr�s���
$�
;�
;r
r
rLc��yr�rrr
rr�zmBaseFutureDoneCallbackTests.test_use_after_free_on_fut_callback_0_with_evil__getattribute__.<locals>.<lambda>s��Sr
r)r rr�r�rcrSr�r�r�rr=)r$r
�	evil_loopr�rs   @@r�?test_use_after_free_on_fut_callback_0_with_evil__getattribute__z[BaseFutureDoneCallbackTests.test_use_after_free_on_fut_callback_0_with_evil__getattribute__�s����
	;�/�
	;�"�O�	�
�Z�Z�
�
�t�V�Y�
7��"�"�$�C��M�M�#�,�,�.�)�4�(�N��!�!�.�1����m�S�^�^�V�D�
8�
7�
7�s�A&B,�,B5c���G�fd�dt�}|�}tjj|d|�5|j	��|j�j
�|�tj�}tj�}�j||��~~|jt�jd�ddd�y#1swYyxYw)Nc�*���eZdZ�fd�Z�fd�Z�xZS)�qBaseFutureDoneCallbackTests.test_use_after_free_on_fut_context_0_with_evil__getattribute__.<locals>.EvilEventLoopc�.��t�|�|i|��t�r	rrs   �rr�z{BaseFutureDoneCallbackTests.test_use_after_free_on_fut_context_0_with_evil__getattribute__.<locals>.EvilEventLoop.call_soon
rr
c�n��|dk(r�jt���tj||�S)Nr�rs)rpr r�r)r$rr�s  �rrz�BaseFutureDoneCallbackTests.test_use_after_free_on_fut_context_0_with_evil__getattribute__.<locals>.EvilEventLoop.__getattribute__s0����;�&��L�L�&9�&;�L�<��.�.�t�T�:�:r
r	)rOr�s@�rr
rs���
$�
;�
;r
r
rL)�contextr)r rr�r�rcrSr�rur�r�rr=)r$r
rr�
fut_context_0r�s     @r�>test_use_after_free_on_fut_context_0_with_evil__getattribute__zZBaseFutureDoneCallbackTests.test_use_after_free_on_fut_context_0_with_evil__getattribute__	s����		;�/�		;�"�O�	�
�Z�Z�
�
�t�V�Y�
7��"�"�$�C��M�M�#�,�,�.�)�4�!�Y�Y�[�N� �I�I�K�M��!�!�.�-�!�H������m�S�^�^�V�D�8�
7�
7�s�BC�C)rrrrJrr�rcr�r�r�r�r�r�r�r�r�r�r�r�r
rrZr[s@rr�r��sa���)�*��"�,�.,�0,�.,�-�,�B)� 
)�*�)�,6�B)�$E�0Er
r�c��eZdZd�Zy)�CFutureDoneCallbackTestsc�B�tj|j��Sry�rr�rLr#s rrcz$CFutureDoneCallbackTests._new_future)s�����T�Y�Y�/�/r
N�rrrrcrr
rrr$s��
0r
rc��eZdZd�Zy)�CSubFutureDoneCallbackTestsc�Z�Gd�dtj�}||j��S)Nc��eZdZy)�;CSubFutureDoneCallbackTests._new_future.<locals>.CSubFutureNr�rr
rr�r3r�r
r�rsr)r$r�s  rrcz'CSubFutureDoneCallbackTests._new_future2s#��	��)�)�	��t�y�y�)�)r
Nrrr
rrr-s��
*r
rc��eZdZd�Zy)�PyFutureDoneCallbackTestsc�B�tj|j��Sry)rr�rLr#s rrcz%PyFutureDoneCallbackTests._new_future;s��� � �d�i�i�0�0r
Nrrr
rr!r!8s��1r
r!c�*��eZdZd�Z�fd�Zd�Z�xZS)�BaseFutureInheritanceTestsc��t�r	r�r#s r�_get_future_clsz*BaseFutureInheritanceTests._get_future_clsAr�r
c���t�|��|j�|_|j	|jj
�yr	rHrNs �rrJz BaseFutureInheritanceTests.setUpDrPr
c���|j�}Gd�d|�}||j��}|jtd�5|j	�ddd�y#1swYyxYw)Nc��eZdZd�Zy)�QBaseFutureInheritanceTests.test_inherit_without_calling_super_init.<locals>.MyFutc��yr	rr`s   rrpzZBaseFutureInheritanceTests.test_inherit_without_calling_super_init.<locals>.MyFut.__init__Ns��r
N)rrrrprr
r�MyFutr*Ms��
r
r,rsz!Future object is not initialized.)r&rLr~rr�)r$r_r,r�s    r�'test_inherit_without_calling_super_initzBBaseFutureInheritanceTests.test_inherit_without_calling_super_initIs[���"�"�$��	�C�	�
����#��
�
#�
#��/�
�
�L�L�N�	
�
�
�s�A�A()rrrr&rJr-rZr[s@rr$r$?s���"�)�
r
r$c��eZdZd�Zy)�PyFutureInheritanceTestsc�"�tjSr	)rr�r#s rr&z(PyFutureInheritanceTests._get_future_cls\s��� � � r
N�rrrr&rr
rr/r/Zs��!r
r/c��eZdZd�Zy)�CFutureInheritanceTestsc�"�tjSr	)rr�r#s rr&z'CFutureInheritanceTests._get_future_clsds�����r
Nr1rr
rr3r3`s�� r
r3�__main__).r�concurrent.futuresr#rxr�rCr�unittestr�typesrr
rrp�test.test_asynciorr�r�rrrrrr�r�base_events�
BaseEventLoopr r,�TestCaserFr]�
skipUnlessr�r�r�r�r�rrr!r$r/r3r�mainrr
r�<module>r?s7����	�	�
��������1��(�
�	�	��I��	�'�-�-�;�;�	�0�0�f�
�#�#��$p8�p8�f����W�W�j�1�5�7�%*�?�J�$7�$7�%*�7�%*�P����W�W�j�1�5�7��o�z�':�':��7���O�Z�%8�%8��zE�zE�z	����W�W�j�1�5�7�0�:�)�2�2�0�7�0�����W�W�j�1�5�7�*�"=�",�"5�"5�*�7�*�1� ;� *� 3� 3�1���6!�9�)�2�2�!�����W�W�j�1�5�7� �8�(�1�1� �7� ��z���H�M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit