HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/lib/python3.11/test/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3.11/test/__pycache__/test_support.cpython-311.pyc
�

*�Kg�g�� �ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZddlmZddlmZddlmZddlmZejZGd�d	ej��Zed
krej��dSdS)�N)�support)�
import_helper)�	os_helper)�
script_helper)�
socket_helper)�warnings_helperc�|�eZdZed���Zed���Zd�Zd�Zd�Zd�Z	e
jd��d���Zd	�Z
d
�Zd�Zd�Zej��d
���Zej��d���Zej��d���Zd�Zd�Zd�Zd�Zej��d���Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d �Z'd!�Z(d"�Z)d#�Z*d$�Z+d%�Z,d&�Z-Gd'�d(��Z.Gd)�d*��Z/d+�Z0d,�Z1d-�Z2e
j3e4e5d.��oe4e5d/��d0��ej��d1�����Z6ej7��d=d3���Z8d4�Z9d5�Z:d6�Z;e
j<ej=d7��e
j<ej>d8��d9�����Z?d:�Z@d;�ZAd<�ZBd2S)>�TestSupportc���ttj��}tjdd���|_tjdd���|_ttj��|dzksJ�dS)Nztest.support.warnings_helperz.*used in test_support.*)�likeztest.test_supportz!.*You should NOT be seeing this.*�)�len�warnings�filtersr�ignore_deprecations_from�_warnings_helper_token�_test_support_token��cls�orig_filter_lens  �(/usr/lib/python3.11/test/test_support.py�
setUpClasszTestSupport.setUpClasss}���h�.�/�/��%,�%E�*�1K�&
�&
�&
��"�#*�"B��&I�#
�#
�#
����8�#�$�$��!�(;�;�;�;�;�;�;�c��ttj��}tj|j|j��ttj��|dz
ksJ�dS)Nr
)rrrr�clear_ignored_deprecationsrrrs  r�
tearDownClasszTestSupport.tearDownClass&s\���h�.�/�/���*��&��#�	
�	
�	
��8�#�$�$��!�(;�;�;�;�;�;�;rc��tjd���5}tj��tjdt
��d�|D��}ddd��n#1swxYwY|�t|��d|��dS)z9Test support.ignore_deprecations_from() silences warningsT)�recordzYou should NOT be seeing this.c�6�g|]}t|j����S���str�message��.0�ws  r�
<listcomp>zDTestSupport.test_ignored_deprecations_are_silent.<locals>.<listcomp>4s ��=�=�=�1��A�I���=�=�=rNr)r�catch_warningsr�_warn_about_deprecation�warn�DeprecationWarning�assertEqualr)�self�warning_objs�messagess   r�$test_ignored_deprecations_are_silentz0TestSupport.test_ignored_deprecations_are_silent/s���
�
$�D�
1�
1�
1�	>�\��3�5�5�5��M�:�<N�O�O�O�=�=��=�=�=�H�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>����	>�	>�	>�	>�	
����X����8�4�4�4�4�4s�:A�A �#A c��tjd��|�tjtjd��dS)N�ftplib�foo)r�
import_module�assertRaises�unittest�SkipTest�r-s r�test_import_modulezTestSupport.test_import_module7sB���#�H�-�-�-����(�+�'�5�u�	>�	>�	>�	>�	>rc�.�tjd��dS)Nr2)r�import_fresh_moduler8s r�test_import_fresh_modulez$TestSupport.test_import_fresh_module<s���)�(�3�3�3�3�3rc��|�tj|d��|j��|�t
jtj|d��dS)N�test_get_attributer3)r,r�
get_attributer>r5r6r7r8s rr>zTestSupport.test_get_attribute?sV������.�t�5I�J�J��/�	1�	1�	1����(�+�W�-B�D�%�P�P�P�P�Przfailing buildbotsc�h�|�tj��tj��dS�N)r,r�get_original_stdout�sys�stdoutr8s r�test_get_original_stdoutz$TestSupport.test_get_original_stdoutDs)������4�6�6��
�C�C�C�C�Crc��ddl}|�dtj��t	jd��|�dtj��dS)Nr�sched)rG�assertInrC�modulesr�unload�assertNotIn)r-rGs  r�test_unloadzTestSupport.test_unloadHsP�������
�
�g�s�{�+�+�+���W�%�%�%�����#�+�.�.�.�.�.rc�8�ttdd���5}	ddd��n#1swxYwYtjt��|�t
j�t����tjt��dS)Nr&�utf-8��encoding)�open�TESTFNr�unlink�assertFalse�os�path�exists)r-�fs  r�test_unlinkzTestSupport.test_unlinkNs���
�&�#��
0�
0�
0�	�A��	�	�	�	�	�	�	�	�	�	�	����	�	�	�	���� � � ���������/�/�0�0�0���� � � � � s�&�*�*c���tjdz}tj�|d��}tj|��tj|��tj|��|�tj�|����tj
tdd��5tj|��ddd��n#1swxYwYtj|��tj|��tj|tj
tjz��tj
tdd��5tj|��ddd��n#1swxYwY|�tj�|����tj|��tj|��tj|d��tj
tdd��5tj|��ddd��n#1swxYwY|�tj�|����dS)N�d�subdir�verboser)rrRrUrV�join�mkdir�rmtreerTrWr�	swap_attr�chmod�stat�S_IRUSR�S_IXUSR)r-�dirpath�
subdirpaths   r�test_rmtreezTestSupport.test_rmtreeUs����"�S�(���W�\�\�'�8�4�4�
�
������
���������!�!�!���������0�0�1�1�1�
�
�w�	�1�
5�
5�	&�	&���W�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�	������
������
���$�,�t�|�3�4�4�4�
�
�w�	�1�
5�
5�	&�	&���W�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&���������0�0�1�1�1�
������
������
���!����
�
�w�	�1�
5�
5�	&�	&���W�%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&���������0�0�1�1�1�1�1s6�9C�C�!C�E5�5E9�<E9�
H+�+H/�2H/c���tdz}t|dd���5}td|���ddd��n#1swxYwYtj�dtj��tj	��	tt��}|�ttj��tjt��|�ttj��tjd=t!j|��t!jd��dS#tjd=t!j|��t!jd��wxYw)	Nz.pyr&rNrOzfoo = 1��filer�__pycache__)rRrQ�printrCrV�insertrU�curdir�	importlib�invalidate_caches�
__import__rHrIr�forgetrKrrSr`)r-�mod_filenamerX�mods    r�test_forgetzTestSupport.test_forgetmsb����~��
�,��g�
6�
6�
6�	%�!��)�!�$�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%������2�9�%�%�%��#�%�%�%�		,��V�$�$�C��M�M�&�#�+�.�.�.�� ��(�(�(����V�S�[�1�1�1�������\�*�*�*���]�+�+�+�+�+��������\�*�*�*���]�+�+�+�+���s�;�?�?�A7D2�27E)c�n�tjtjdf��}|���dS)Nr)�socket�
create_serverr�HOST�close�r-�ss  r�	test_HOSTzTestSupport.test_HOST~s+��� �-�"4�a�!8�9�9��	���	�	�	�	�	rc��tj��}tjtj|f��}|���dSrA)r�find_unused_portrxryrzr{)r-�portr}s   r�test_find_unused_portz!TestSupport.test_find_unused_port�s9���-�/�/��� �-�"4�d�!;�<�<��	���	�	�	�	�	rc��tj��}tj|��|���|���dSrA)rxr�	bind_port�listenr{r|s  r�test_bind_portzTestSupport.test_bind_port�s<���M�O�O�����"�"�"�	���
�
�
�	���	�	�	�	�	rc��tj��}tj�|��}	tj�|d��}|�tj�|����tj	|��5}|�
||��|�tj�|����ddd��n#1swxYwY|�tj�|����tj|��dS#tj|��wxYw)z8Test that temp_dir() creates and destroys its directory.�tempN)
�tempfile�mkdtemprUrV�realpathr^rT�isdirr�temp_dirr,�
assertTruer`)r-�
parent_dirrV�	temp_paths    r�
test_temp_dirzTestSupport.test_temp_dir�sL���%�'�'�
��W�%�%�j�1�1�
�	)��7�<�<�
�F�3�3�D����R�W�]�]�4�0�0�1�1�1��#�D�)�)�
5�Y�� � ��D�1�1�1������
�
�d� 3� 3�4�4�4�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5����
5�
5�
5�
5�
���R�W�]�]�4�0�0�1�1�1���Z�(�(�(�(�(��I��Z�(�(�(�(���s1�A&E�A	C/�#E�/C3�3E�6C3�75E�Ec�$�tj��5}|�tj�|����ddd��n#1swxYwY|�tj�|����dS)zTest passing no path.N)rr�r�rUrVr�rT)r-r�s  r�test_temp_dir__path_nonez$TestSupport.test_temp_dir__path_none�s���
�
�
!�
!�	6�Y��O�O�B�G�M�M�)�4�4�5�5�5�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6����	6�	6�	6�	6��������y�1�1�2�2�2�2�2s�3A�A�Ac���d�}tj��}tj�|��}	|�tj�|����|�t||��|�tj�|����tj
|��dS#tj
|��wxYw)z-Test passing a directory that already exists.c�d�tj|��5}td���#1swxYwYdS�Nzshould not get here)rr��	Exception)rVr�s  r�
call_temp_dirzMTestSupport.test_temp_dir__existing_dir__quiet_default.<locals>.call_temp_dir�s[���#�D�)�)�
7�Y�� 5�6�6�6�
7�
7�
7�
7����
7�
7�
7�
7�
7�
7��%�)�)N)r�r�rUrVr�r�r�r5�FileExistsError�shutilr`)r-r�rVs   r�*test_temp_dir__existing_dir__quiet_defaultz6TestSupport.test_temp_dir__existing_dir__quiet_default�s���	7�	7�	7���!�!���w����%�%��	 ��O�O�B�G�M�M�$�/�/�0�0�0����o�}�d�C�C�C��O�O�B�G�M�M�$�/�/�0�0�0��M�$�������F�M�$�������s�BC
�
C#c���tj��}tj�|��}	tj��5}tj|d���5}|�	||��ddd��n#1swxYwYd�|j
D��}ddd��n#1swxYwY|�tj�|����tj|��n#tj|��wxYw|�	t|��d|��|d}|�|�d|�d���|��dS)	z=Test passing a directory that already exists with quiet=True.T��quietNc�6�g|]}t|j����Sr r!r$s  rr'zGTestSupport.test_temp_dir__existing_dir__quiet_true.<locals>.<listcomp>�� ��F�F�F�q�C��	�N�N�F�F�Fr�rz5tests may fail, unable to create temporary directory �: )r�r�rUrVr�r�check_warningsrr�r,rr�r�r�r`r�
startswith)r-rV�recorderr�rr*s      r�'test_temp_dir__existing_dir__quiet_truez3TestSupport.test_temp_dir__existing_dir__quiet_true�s�����!�!���w����%�%��	 � �/�1�1�
G�X��'��D�9�9�9�6�Y��$�$�T�9�5�5�5�6�6�6�6�6�6�6�6�6�6�6����6�6�6�6�F�F�H�4E�F�F�F��
G�
G�
G�
G�
G�
G�
G�
G�
G�
G�
G����
G�
G�
G�
G�

�O�O�B�G�M�M�$�/�/�0�0�0��M�$������F�M�$������������X����8�4�4�4���{��������)J�?C�)J�)J�)J�K�K��	�	�	�	�	sS�C;�B)�B�5B)�B	�B)�B	�	B)�C;�)B-�-C;�0B-�15C;�;Dc�T�tjdtjd����dS)z?Test that a forked child process does not remove the directory.�-ca
            import os
            from test import support
            from test.support import os_helper
            with os_helper.temp_cwd() as temp_path:
                pid = os.fork()
                if pid != 0:
                    # parent process

                    # wait for the child to terminate
                    support.wait_process(pid, exitcode=0)

                    # Make sure that temp_path is still present. When the child
                    # process leaves the 'temp_cwd'-context, the __exit__()-
                    # method of the context must not remove the temporary
                    # directory.
                    if not os.path.isdir(temp_path):
                        raise AssertionError("Child removed temp_path.")
        N)r�assert_python_ok�textwrap�dedentr8s r�test_temp_dir__forked_childz'TestSupport.test_temp_dir__forked_child�s8��
	�&�t�X�_�>�.
�.
�	�	�	�	�	rc��tj��}tj��5}tj|��5}|�||��|�tj��|��ddd��n#1swxYwYddd��n#1swxYwY|�tj��|��dSrA)rU�getcwdrr��
change_cwdr,)r-�original_cwdr��new_cwds    r�test_change_cwdzTestSupport.test_change_cwd�s'���y�{�{��
�
�
!�
!�	7�Y��%�i�0�0�
7�G�� � ��)�4�4�4�� � �����g�6�6�6�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7�
7����
7�
7�
7�
7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7�	7����	7�	7�	7�	7�
	
�������l�3�3�3�3�3s4�B�>B�:B�B
	�
B�
B
	�B�B!�$B!c�N�tj��}d�}tj��5}tj�|d��}|�t||��ddd��n#1swxYwY|�tj��|��dS)z&Test passing a non-existent directory.c�d�tj|��5}td���#1swxYwYdSr�)rr�r�)rVr�s  r�call_change_cwdzFTestSupport.test_change_cwd__non_existent_dir.<locals>.call_change_cwd�s[���%�d�+�+�
7�w�� 5�6�6�6�
7�
7�
7�
7����
7�
7�
7�
7�
7�
7r��does_not_existN)	rUr�rr�rVr^r5�FileNotFoundErrorr,)r-r�r�r��non_existent_dirs     r�!test_change_cwd__non_existent_dirz-TestSupport.test_change_cwd__non_existent_dir�s����y�{�{��	7�	7�	7��
�
!�
!�	0�Z�!�w�|�|�J�8H�I�I�����/��.�
0�
0�
0�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0�	0����	0�	0�	0�	0�
	
�������l�3�3�3�3�3s�=A3�3A7�:A7c���tj��}tj��5}tj�|d��}t
j��5}tj|d���5}|�	||��|�	tj��|��ddd��n#1swxYwYd�|j
D��}ddd��n#1swxYwYddd��n#1swxYwY|�	t|��d|��|d}|�|�
d|�d	���|��dS)
z6Test passing a non-existent directory with quiet=True.r�Tr�Nc�6�g|]}t|j����Sr r!r$s  rr'zMTestSupport.test_change_cwd__non_existent_dir__quiet_true.<locals>.<listcomp>
r�rr�r�Btests may fail, unable to change the current working directory to r�)rUr�rr�rVr^rr�r�r,rrr�r�)r-r�r��bad_dirr�r�rr*s        r�-test_change_cwd__non_existent_dir__quiet_truez9TestSupport.test_change_cwd__non_existent_dir__quiet_trues-���y�{�{��
�
�
!�
!�	G�Z��g�l�l�:�/?�@�@�G� �/�1�1�
G�X��)�'��>�>�>�;�'��$�$�W�l�;�;�;��$�$�R�Y�[�[�'�:�:�:�;�;�;�;�;�;�;�;�;�;�;����;�;�;�;�G�F�H�4E�F�F�F��	
G�
G�
G�
G�
G�
G�
G�
G�
G�
G�
G����
G�
G�
G�
G�	G�	G�	G�	G�	G�	G�	G�	G�	G�	G�	G����	G�	G�	G�	G�	
����X����8�4�4�4���{��������)<�.5�)<�)<�)<�=�=��	�	�	�	�	sY�4C;�C$�2>B<�0C$�<C�C$�C�C$�C;�$C(	�(C;�+C(	�,C;�;C?�C?c��tdz}tj��5}tj|d���5	ddd��n#1swxYwYd�|jD��}ddd��n#1swxYwY|�t|��d|��|d}|�|�	d|�d	���|��dS)
z0Check the warning message when os.chdir() fails.�_does_not_existT)rVr�Nc�6�g|]}t|j����Sr r!r$s  rr'z>TestSupport.test_change_cwd__chdir_warning.<locals>.<listcomp>s ��B�B�B�1��A�I���B�B�Brr�rr�r�)
rRrr�rr�rr,rr�r�)r-rVr�r/�msgs     r�test_change_cwd__chdir_warningz*TestSupport.test_change_cwd__chdir_warningsw���)�)��
�
+�
-�
-�	C���%�4�t�<�<�<�
�
��
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�B�B��0A�B�B�B�H�	C�	C�	C�	C�	C�	C�	C�	C�	C�	C�	C����	C�	C�	C�	C�
	
����X����8�4�4�4��q�k��������(8�-1�(8�(8�(8�9�9��	�	�	�	�	s3�A+�A�A+�A	�A+�
A	�A+�+A/�2A/c���tj��}tjt���5|�tj�tj����t��ddd��n#1swxYwY|�tj�	t����|�tj��|��dS)N��name)
rUr�r�temp_cwdrRr,rV�basenamerTrW)r-�heres  r�
test_temp_cwdzTestSupport.test_temp_cwd&s����y�{�{��
�
�V�
,�
,�
,�	D�	D����R�W�-�-�b�i�k�k�:�:�F�C�C�C�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D�	D����	D�	D�	D�	D���������/�/�0�0�0��������d�+�+�+�+�+s�A
B�B�Bc��tj��}tjd���5}|�||��|�tj�|����|�tj��|��ddd��n#1swxYwY|�tj��|��dS)z Test passing None to temp_cwd().Nr�)	rUr�rr��assertNotEqualr�rVr�r,)r-r�r�s   r�test_temp_cwd__name_nonez$TestSupport.test_temp_cwd__name_none.s����y�{�{��
�
�T�
*�
*�
*�	3�g������6�6�6��O�O�B�G�M�M�'�2�2�3�3�3����R�Y�[�[�'�2�2�2�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3����	3�	3�	3�	3�	
�������l�3�3�3�3�3s�A0B%�%B)�,B)c�^�|�tjdddd���d��dS)N�r
r�)r�r
r�z{1: 1, 2: 2, 3: 3})r,r�sortdictr8s r�
test_sortdictzTestSupport.test_sortdict7s2������)�Q�!�q�/�/�:�:�<P�Q�Q�Q�Q�Qrc��tj��}|�t��5}t	j|d��ddd��n#1swxYwY|�|jjtj	��dS)Nsfoo)
r�make_bad_fdr5�OSErrorrU�writer,�	exception�errno�EBADF)r-�fd�cms   r�test_make_bad_fdzTestSupport.test_make_bad_fd:s���
�
"�
$�
$��
�
�
�w�
'�
'�	!�2��H�R�� � � �	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!������+�U�[�9�9�9�9�9s�A�A�Ac���tj|ddd���|�t��5tj|d��ddd��dS#1swxYwYdS)Nz	def classr��)�lineno�offsetzx=1)r�check_syntax_errorr5�AssertionErrorr8s r�test_check_syntax_errorz#TestSupport.test_check_syntax_error@s����"�4��Q�q�I�I�I�I�
�
�
�~�
.�
.�	4�	4��&�t�U�3�3�3�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4�	4����	4�	4�	4�	4�	4�	4s�A�A�Ac��ddl}tjd��5|jd��ddd��dS#1swxYwYdS)Nr�pprint)rpr�CleanImportr4)r-rps  r�test_CleanImportzTestSupport.test_CleanImportEs�������
�
&�x�
0�
0�	.�	.�#�I�#�H�-�-�-�	.�	.�	.�	.�	.�	.�	.�	.�	.�	.�	.�	.����	.�	.�	.�	.�	.�	.s�7�;�;c�`�tjdd��5|�dtj��|�dtj��ddd��n#1swxYwY|�dtj��|�dtj��dS)Nr3�bar)r�
DirsOnSysPathrHrCrVrKr8s r�test_DirsOnSysPathzTestSupport.test_DirsOnSysPathJs���
�
(���
6�
6�	+�	+��M�M�%���*�*�*��M�M�%���*�*�*�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+����	+�	+�	+�	+�	
������)�)�)�������)�)�)�)�)s�AA#�#A'�*A'c���tj��5}td��ddd��n#1swxYwY|�|���d��dS)N�hello�hello
)r�captured_stdoutrmr,�getvalue)r-rDs  r�test_captured_stdoutz TestSupport.test_captured_stdoutQs���
�
$�
&�
&�	�&��'�N�N�N�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�������*�*�I�6�6�6�6�6s�0�4�4c���tj��5}tdtj���ddd��n#1swxYwY|�|���d��dS)Nr�rjr�)r�captured_stderrrmrC�stderrr,r�)r-r�s  r�test_captured_stderrz TestSupport.test_captured_stderrVs���
�
$�
&�
&�	,�&��'��
�+�+�+�+�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,�	,����	,�	,�	,�	,�������*�*�I�6�6�6�6�6s�<�A�Ac��tj��5}|�d��|�d��t	��}ddd��n#1swxYwY|�|d��dS)Nr�rr�)r�captured_stdinr��seek�inputr,)r-�stdin�captureds   r�test_captured_stdinzTestSupport.test_captured_stdin[s���
�
#�
%�
%�	���K�K�	�"�"�"��J�J�q�M�M�M��w�w�H�		�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
	
����7�+�+�+�+�+s�9A�A� Ac�,�tj��dSrA)r�
gc_collectr8s r�test_gc_collectzTestSupport.test_gc_collectcs��������rc�^�|�tj��t��dSrA)�assertIsInstancer�python_is_optimized�boolr8s r�test_python_is_optimizedz$TestSupport.test_python_is_optimizedfs'�����g�9�;�;�T�B�B�B�B�Brc���Gd�d��}|��}d|_tj|dd��5}|�|jd��|�|d��ddd��n#1swxYwY|�|jd��tj|dd��5}|�|jd��|�|��ddd��n#1swxYwY|�t|d����tj|dd��5|`ddd��n#1swxYwY|�t|d����dS)Nc��eZdZdS)�'TestSupport.test_swap_attr.<locals>.ObjN)�__name__�
__module__�__qualname__r rr�Objrjs�������Drrr��xr��y)rrrar,r
�assertIsNonerT�hasattr)r-r�objrr
s     r�test_swap_attrzTestSupport.test_swap_attris1��	�	�	�	�	�	�	�	��c�e�e�����
�
�s�C��
+�
+�	#�q����S�U�A�&�&�&����Q��"�"�"�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�	
������"�"�"�
�
�s�C��
+�
+�	!�q����S�U�A�&�&�&����a� � � �	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�	
�����c�*�*�+�+�+�
�
�s�C��
+�
+�	�	���	�	�	�	�	�	�	�	�	�	�	����	�	�	�	������c�*�*�+�+�+�+�+s5�2A3�3A7�:A7�/1C,�,C0�3C0�0D?�?E�Ec�~�ddi}tj|dd��5}|�|dd��|�|d��ddd��n#1swxYwY|�|dd��tj|dd��5}|�|dd��|�|��ddd��n#1swxYwY|�d|��tj|dd��5|d=ddd��n#1swxYwY|�d|��dS)Nrr�r�r
)r�	swap_itemr,rrK)r-�Drr
s    r�test_swap_itemzTestSupport.test_swap_itemzs���
��G��
�
�q�#�q�
)�
)�	#�Q����Q�s�V�Q�'�'�'����Q��"�"�"�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�	
����3���#�#�#�
�
�q�#�q�
)�
)�	!�Q����Q�s�V�Q�'�'�'����a� � � �	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�	
����a� � � �
�
�q�#�q�
)�
)�	�	��#��	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�����a� � � � � s5�3A�A�!A�2C�C�C�D�D �#D c��eZdZdZdZdZdZdS)�TestSupport.RefClassN)rr	r
�
attribute1�
attribute2�_hidden_attribute1�__magic_1__r rr�RefClassr�s#�������
��
�!�����rrc��eZdZdZdZdZdZdS)�TestSupport.OtherClassN)rr	r
r�
attribute3r�__magic_2__r rr�
OtherClassr�s"�������
��
������rr!c���tj|j|j��}|�dh|��tj|j|j��}|�ddh|��dS)Nrrr )r�detect_api_mismatchrr!r,)r-�
missing_itemss  r�test_detect_api_mismatchz$TestSupport.test_detect_api_mismatch�su���3�D�M�48�O�E�E�
����,���7�7�7��3�D�O�48�M�C�C�
����,�
�6�
�F�F�F�F�Frc��gd�}tj|j|j|���}|�t��|��tj|j|j|���}|�t��|��dS)N)rrr �
not_in_either)�ignore)rr#rr!r,�set)r-r(r$s   r� test_detect_api_mismatch__ignorez,TestSupport.test_detect_api_mismatch__ignore�s���M�M�M���3��
�t��v�?�?�?�
�������
�.�.�.��3�����v�?�?�?�
�������
�.�.�.�.�.rc���dh}dh}tj|t||���hd�}hd�}tj|td||���|�t
tj|t��dS)N�tempdir�template)�extra�not_exported>�	makeSuite�
findTestCases�TextTestResult�installHandler�getTestCaseNames>�
load_tests�TestProgram�
BaseTestSuite)zunittest.resultz
unittest.casezunittest.suitezunittest.loaderz
unittest.mainzunittest.runnerzunittest.signalszunittest.async_case)r�check__all__r�r6r5r�)r-r.r/s   r�test_check__all__zTestSupport.test_check__all__�s������"�|����T�%�#(�*6�	8�	8�	8�	8�

�
�
��F�E�E����T�%�I�$)�*6�	8�	8�	8�	8�	
���.�'�*>��h�O�O�O�O�Or�waitpid�WNOHANGz need os.waitpid() and os.WNOHANGc�r�tj��tj��}|dkrtjd��tj��}tj��tjz}tj}	dt_tj
��}	tj��|kr|�d��tjtj
d|��5tj��ddd��n#1swxYwYtjrntjd����d|z}|�||�����|�tj��|t_n#|t_wxYwtj��dS)NrFT�timeout�orig_stderrg�������?z2Warning -- reap_children() reaped child process %s)r�
reap_childrenrU�fork�_exit�time�	monotonic�
SHORT_TIMEOUT�environment_altered�io�StringIO�failra�
print_warning�sleeprHr�r�)r-�pid�t0�deadline�was_alteredr�r�s       r�test_reap_childrenzTestSupport.test_reap_children�s���
	������g�i�i���!�8�8��H�Q�K�K�K�
�^�
�
���>�#�#�g�&;�;���1��	6�*/�G�'��[�]�]�F�

"��>�#�#�h�.�.��I�I�i�(�(�(��&�w�'<�m�V�T�T�,�,��)�+�+�+�,�,�,�,�,�,�,�,�,�,�,����,�,�,�,�
�.����
�5�!�!�!�

"�G��L�C��M�M�#�v���0�0�1�1�1��O�O�G�7�8�8�8�*5�G�'�'��+�G�'�5�5�5�5�	������s2�A,F�-D
�F�
D�F�D�A1F�F!Nc��d|�d|�d�}tjg|�d�|�}d�tj���D��}tj|t
jt
jd|���}|�|}|�	|j
���t|����|�	|j
d��dS)	Nzfrom test.support import z
; print(repr(z()))r�c�D�i|]\}}|�d���||��S)�PYTHON)r�)r%�key�values   r�
<dictcomp>z-TestSupport.check_options.<locals>.<dictcomp>�s>��0�0�0�j�c�5��n�n�X�.�.�0�s�E�0�0�0rT)rDr��universal_newlines�envr)rC�
executablerU�environ�items�
subprocess�run�PIPE�DEVNULLr,rD�rstrip�repr�
returncode)r-�args�func�expected�code�cmdrW�procs        r�
check_optionszTestSupport.check_options�s���H�4�H�H�d�H�H�H���~�1��1�d�1�D�1��0�0�B�J�,<�,<�,>�,>�0�0�0���~�c�%/�_�%/�%7�15�"%�	'�'�'��
���H������+�+�-�-�t�H�~�~�>�>�>������!�,�,�,�,�,rc�(�gdgdgdgdgdgdgdgdgd	gd
gdgdgd
dggd�d
dgd
dgd
dgd
dgd
dgfD]F}|�|���5|�|d��ddd��n#1swxYwY�G|�gd�dd	g��dS)Nz-B�-sz-S�-Ez-vz-b�-Pz-q�-Iz-bbz-vvv�-Wignore�-X�dev)rnrorp�faulthandler�
importtime�showrefcount�tracemallocz
tracemalloc=3��opts�args_from_interpreter_flags)rmrkrjrl��subTestrh�r-rvs  r� test_args_from_interpreter_flagsz,TestSupport.test_args_from_interpreter_flagssW��
�
�F�
�F�
�F�
�F�
�F�
�F�
�F�
�F�
�F�
�G�
�H�
�L�
�5�M�%�%�%�
�>�"�
�<� �
�>�"�
�=�!�
�?�#�3
�	H�	H�D�6���4��(�(�
H�
H��"�"�4�)F�G�G�G�
H�
H�
H�
H�
H�
H�
H�
H�
H�
H�
H����
H�
H�
H�
H��	
���3�3�3�8� �6�	#�	#�	#�	#�	#s�	A,�,A0	�3A0	c��gdgdgdgfD]F}|�|���5|�|d��ddd��n#1swxYwY�GdS)Nz-Oz-OOz-OOOOru�!optim_args_from_interpreter_flagsrxrzs  r�&test_optim_args_from_interpreter_flagsz2TestSupport.test_optim_args_from_interpreter_flags%s���
�
�F�
�G�
�I�
�	N�	N�D����4��(�(�
N�
N��"�"�4�)L�M�M�M�
N�
N�
N�
N�
N�
N�
N�
N�
N�
N�
N����
N�
N�
N�
N��	N�	Ns�A�A		�A		c�X�Gd�d��}|d��}|d��}tjtdd��5tjg��|�tj|����|�tj|����tjdd��|�tj|����|�tj|����tj|���gd��|�tj|����|�tj|����tjdgd��|�tj|����|�tj|����tjdgd��|�tj|����|�tj|����tjdgd��|�tj|����tjd	gd��|�tj|����tjd
gd��|�tj|����|�tj|����tj|���|���gd��|�tj|����|�tj|����tjddgd��|�tj|����|�tj|����ddd��n#1swxYwYtjtdd��5tjg�
��|�tj|����|�tj|����tjdd��|�tj|����|�tj|����tjd|���g��|�tj|����|�tj|����tjddg��|�tj|����|�tj|����tjddg��|�tj|����|�tj|����tjddg��|�tj|����tjdd	g��|�tj|����tjdd
g��|�tj|����|�tj|����tjd|���|���g��|�tj|����|�tj|����tjdddg��|�tj|����|�tj|����ddd��dS#1swxYwYdS)Nc��eZdZd�Zd�ZdS)�)TestSupport.test_match_test.<locals>.Testc��||_dSrA��test_id)r-r�s  r�__init__z2TestSupport.test_match_test.<locals>.Test.__init__3s
��&����rc��|jSrAr�r8s r�idz,TestSupport.test_match_test.<locals>.Test.id6s
���|�#rN)rr	r
r�r�r rr�Testr�2s2������
'�
'�
'�
$�
$�
$�
$�
$rr�z"test.test_os.FileTests.test_accessz'test.test_os.Win32ErrorTests.test_chdir�_match_test_func�test_osztest_*�	filetests�	FileTestsz*test_os.*.test_*�test_access�	DONTMATCH)�ignore_patterns)rra�set_match_testsr��
match_testr�rT)r-r�r��
test_chdirs    r�test_match_testzTestSupport.test_match_test1si��	$�	$�	$�	$�	$�	$�	$�	$��d�?�@�@���T�C�D�D�
��
�w�(:�D�
A�
A�,	=�,	=��#�B�'�'�'��O�O�G�.�{�;�;�<�<�<��O�O�G�.�z�:�:�;�;�;�
�#�D�$�/�/�/��O�O�G�.�{�;�;�<�<�<��O�O�G�.�z�:�:�;�;�;�
�#�[�^�^�%5�%5�$6��=�=�=��O�O�G�.�{�;�;�<�<�<����W�/�
�;�;�<�<�<�
�#�Y�K��6�6�6��O�O�G�.�{�;�;�<�<�<��O�O�G�.�z�:�:�;�;�;�
�#�X�J��5�5�5��O�O�G�.�{�;�;�<�<�<��O�O�G�.�z�:�:�;�;�;�
�#�[�M�4�8�8�8����W�/��<�<�=�=�=��#�[�M�4�8�8�8��O�O�G�.�{�;�;�<�<�<�
�#�%8�$9�4�@�@�@��O�O�G�.�{�;�;�<�<�<��O�O�G�.�z�:�:�;�;�;�
�#�[�^�^�%5�%5�z�}�}���$G��N�N�N��O�O�G�.�{�;�;�<�<�<��O�O�G�.�z�:�:�;�;�;��#�]�K�$@�$�G�G�G��O�O�G�.�{�;�;�<�<�<����W�/�
�;�;�<�<�<�Y,	=�,	=�,	=�,	=�,	=�,	=�,	=�,	=�,	=�,	=�,	=����,	=�,	=�,	=�,	=�^�
�w�(:�D�
A�
A�,	<�,	<��#�B�7�7�7�7��O�O�G�.�{�;�;�<�<�<��O�O�G�.�z�:�:�;�;�;�
�#�D�$�/�/�/��O�O�G�.�{�;�;�<�<�<��O�O�G�.�z�:�:�;�;�;�
�#�D�;�>�>�+;�+;�*<�=�=�=����W�/��<�<�=�=�=��O�O�G�.�z�:�:�;�;�;�
�#�D�9�+�6�6�6����W�/��<�<�=�=�=����W�/�
�;�;�<�<�<�
�#�D�8�*�5�5�5����W�/��<�<�=�=�=����W�/�
�;�;�<�<�<�
�#�D�;�-�8�8�8��O�O�G�.�{�;�;�<�<�<��#�D�;�-�8�8�8����W�/��<�<�=�=�=�
�#�D�+>�*?�@�@�@����W�/��<�<�=�=�=����W�/�
�;�;�<�<�<�
�#�D�;�>�>�+;�+;�Z�]�]�_�_�*M�N�N�N����W�/��<�<�=�=�=����W�/�
�;�;�<�<�<��#�D�=�+�*F�G�G�G����W�/��<�<�=�=�=��O�O�G�.�z�:�:�;�;�;�Y,	<�,	<�,	<�,	<�,	<�,	<�,	<�,	<�,	<�,	<�,	<�,	<����,	<�,	<�,	<�,	<�,	<�,	<s%�OP�P�"P�O`�`#�&`#zUnstable in EmscriptenzUnavailable on WASIc�*�tj��}tjttj��}	tj��}tj|��n#tj|��wxYw|�||z
d��dS)Nr�)r�fd_countrUrQ�__file__�O_RDONLYr{r,)r-�startr��mores    r�
test_fd_countzTestSupport.test_fd_count�sy���"�$�$��
�W�X�r�{�
+�
+��	��%�'�'�D��H�R�L�L�L�L��B�H�R�L�L�L�L����������q�)�)�)�)�)s�A!�!A7c��tj��}tjtjd|��5tj|��ddd��n#1swxYwY|�|���|��dS)Nr>)rFrGrrarIr,r�)r-r�rdr�s    r�check_print_warningzTestSupport.check_print_warning�s��������
�
�w�4�m�V�
L�
L�	'�	'��!�#�&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�������*�*�H�5�5�5�5�5s�A�A�Ac�^�|�dd��|�dd��dS)Nr�zWarning -- msg
za
bzWarning -- a
Warning -- b
)r�r8s r�test_print_warningzTestSupport.test_print_warning�sK��� � ��!3�	5�	5�	5�� � ��!?�	A�	A�	A�	A�	Arc��tjstjdkr!|�tj��dS|�tj��dS)N�win32)r�
is_emscriptenrC�platformrT�has_strftime_extensionsr�r8s r�test_has_strftime_extensionsz(TestSupport.test_has_strftime_extensions�sQ��� �	=�C�L�G�$;�$;����W�<�=�=�=�=�=��O�O�G�;�<�<�<�<�<rrA)Crr	r
�classmethodrrr0r9r<r>r6�skiprErLrYrhrvr�requires_working_socketr~r�r�r�r�r�r��
requires_forkr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr!r%r*r9�
skipUnlessrrUrO�requires_subprocessrhr{r~r��skipIfr��is_wasir�r�r�r�r rrr
r
s��������<�<��[�<��<�<��[�<�5�5�5�>�>�>�
4�4�4�Q�Q�Q�
�X�]�&�'�'�D�D�(�'�D�/�/�/�!�!�!�2�2�2�0,�,�,�"%�W�$�&�&���'�&��%�W�$�&�&���'�&��
%�W�$�&�&���'�&��
)�
)�
)�3�3�3� � � � ���*�W���������44�4�4�
4�
4�
4����*
�
�
�",�,�,�4�4�4�R�R�R�:�:�:�4�4�4�
.�.�.�
*�*�*�7�7�7�
7�7�7�
,�,�,����C�C�C�,�,�,�"!�!�!�����������������G�G�G�	/�	/�	/�P�P�P�6�X�����Y�/�/�J�G�G�B�	�4J�4J�;�=�=��W����) �) ���=�=�) �V!�W� �"�"�
-�
-�
-�#�"�
-�"#�"#�"#�H
N�
N�
N�g<�g<�g<�R�X�_�W�*�,D�E�E��X�_�W�_�&;�<�<�*�*�=�<�F�E�*�6�6�6�A�A�A�=�=�=�=�=rr
�__main__)r�rprFrUr�rxrcr[rCr�r�rBr6r�testr�test.supportrrrrrrR�TestCaser
r�mainr rr�<module>r�sY����������	�	�	�	�	�	�	�	�
�
�
�
�
�
�
�
���������
�
�
�
���������������������������&�&�&�&�&�&�"�"�"�"�"�"�&�&�&�&�&�&�&�&�&�&�&�&�(�(�(�(�(�(�	�	��`
=�`
=�`
=�`
=�`
=�(�#�`
=�`
=�`
=�t�z����H�M�O�O�O�O�O��r