HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/test/test_asyncio/__pycache__/test_threads.cpython-311.opt-2.pyc
�

��Vc����	ddlZddlZddlmZddlmZd�ZGd�dej��Zedkrej	��dSdS)�N)�
ContextVar)�mockc�.�tjd��dS�N)�asyncio�set_event_loop_policy���2D:\Python311\Lib\test\test_asyncio\test_threads.py�tearDownModuler
s���!�$�'�'�'�'�'r
c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�
ToThreadTestsc��zK�tjtddg���d{V��}|�|d��dS)N�(��*)r�	to_thread�sum�assertEqual)�self�results  r�test_to_threadzToThreadTests.test_to_threadsJ�����(��r�1�g�6�6�6�6�6�6�6�6�������$�$�$�$�$r
c��K�d�}|�td��5tj|���d{V��ddd��dS#1swxYwYdS)Nc� �td���)N�test)�RuntimeErrorr	r
r�
raise_runtimez=ToThreadTests.test_to_thread_exception.<locals>.raise_runtimes���v�&�&�&r
r)�assertRaisesRegexrrr)rrs  r�test_to_thread_exceptionz&ToThreadTests.test_to_thread_exceptions�����	'�	'�	'��
#�
#�L�&�
9�
9�	3�	3��#�M�2�2�2�2�2�2�2�2�2�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3����	3�	3�	3�	3�	3�	3s�A	�	A
�A
c��K�tj��}tj|���d{V��|���dSr)r�Mockrr�assert_called_once�r�funcs  r�test_to_thread_oncez!ToThreadTests.test_to_thread_oncesL�����y�{�{�����%�%�%�%�%�%�%�%�%����!�!�!�!�!r
c��K�tj��}g}td��D]+}tj|��}|�|���,tj|��d{V��|�|jd��dS)N�
)	rr!�rangerr�append�gatherr�
call_count)rr$�futs�_�futs     r�test_to_thread_concurrentz'ToThreadTests.test_to_thread_concurrent s������y�{�{�����r���	�	�A��#�D�)�)�C��K�K�������n�d�#�#�#�#�#�#�#�#������"�-�-�-�-�-r
c��K�tj��}tj|dd����d{V��|�dd���dS)NrT)�	something)rr!rr�assert_called_once_withr#s  r�test_to_thread_args_kwargsz(ToThreadTests.test_to_thread_args_kwargs+sZ�����y�{�{�����f��=�=�=�=�=�=�=�=�=�=��$�$�V�t�$�<�<�<�<�<r
c���K�td����fd�}��d��tj|���d{V��}|�|d��dS)N�test_ctxc�,������Sr)�get)r5s�r�get_ctxz9ToThreadTests.test_to_thread_contextvars.<locals>.get_ctx6s����<�<�>�>�!r
�parrot)r�setrrr)rr8rr5s   @r�test_to_thread_contextvarsz(ToThreadTests.test_to_thread_contextvars3s������j�)�)��	"�	"�	"�	"�	"�	���X�����(��1�1�1�1�1�1�1�1�������*�*�*�*�*r
N)	�__name__�
__module__�__qualname__rrr%r/r3r;r	r
rrrsn������%�%�%�3�3�3�"�"�"�	.�	.�	.�=�=�=�	+�	+�	+�	+�	+r
r�__main__)
r�unittest�contextvarsrrr�IsolatedAsyncioTestCaserr<�mainr	r
r�<module>rDs���"���������"�"�"�"�"�"�������(�(�(�.+�.+�.+�.+�.+�H�4�.+�.+�.+�b�z����H�M�O�O�O�O�O��r