%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.12/test/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.12/test/__pycache__/test_support.cpython-312.pyc

�

���f5l��,�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZddlmZddlmZddlmZddlmZej,ZGd�d	ej.�Zed
k(rej4�yy)�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�Zej4�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
jfe4e5d.�xr	e4e5d/�d0�ej4�d1���Z6ejn�dBd3��Z8ejrd4�d5��Z:d6�Z;e
jxejzd7�e
jxej|d8�d9���Z?d:�Z@d;�ZAd<�ZBd=�ZCd>�ZDd?�ZEd@�ZFdA�ZGy2)C�TestSupportc���ttj�}tjdd��|_tjtd��|_ttj�|dzk(sJ�y)Nztest.support.warnings_helperz.*used in test_support.*)�likez!.*You should NOT be seeing this.*�)�len�warnings�filtersr�ignore_deprecations_from�_warnings_helper_token�__name__�_test_support_token��cls�orig_filter_lens  �(/usr/lib/python3.12/test/test_support.py�
setUpClasszTestSupport.setUpClasssf���h�.�.�/��%,�%E�%E�*�1K�&
��"�#*�"B�"B��>�#
����8�#�#�$��!�(;�;�;�;�c���ttj�}tj|j
|j�ttj�|dz
k(sJ�y)Nr
)rrrr�clear_ignored_deprecationsrrrs  r�
tearDownClasszTestSupport.tearDownClass&sR���h�.�.�/���*�*��&�&��#�#�	
��8�#�#�$��!�(;�;�;�;rc�<�tjd��5}tj�tjdt
�|D�cgc]}t
|j���}}ddd�|jt�d|�ycc}w#1swY�+xYw)z9Test support.ignore_deprecations_from() silences warningsT)�recordzYou should NOT be seeing this.Nr)
r�catch_warningsr�_warn_about_deprecation�warn�DeprecationWarning�str�message�assertEqualr)�self�warning_objs�w�messagess    r�$test_ignored_deprecations_are_silentz0TestSupport.test_ignored_deprecations_are_silent/s{��
�
$�
$�D�
1�	>�\��3�3�5��M�M�:�<N�O�0<�=�1��A�I�I��=�H�=�	>�	
����X���8�4��>�	>�	>�s�3B�
B
�&B�
B�Bc��tjd�|jtjtjd�y)N�ftplib�foo)r�
import_module�assertRaises�unittest�SkipTest�r's r�test_import_modulezTestSupport.test_import_module7s1���#�#�H�-����(�+�+�'�5�5�u�	>rc�.�tjd�y)Nr-)r�import_fresh_moduler3s r�test_import_fresh_modulez$TestSupport.test_import_fresh_module<s���)�)�(�3rc���|jtj|d�|j�|j	t
jtj|d�y)N�test_get_attributer.)r&r�
get_attributer9r0r1r2r3s rr9zTestSupport.test_get_attribute?sI������.�.�t�5I�J��/�/�	1����(�+�+�W�-B�-B�D�%�Przfailing buildbotsc�h�|jtj�tj�y�N)r&r�get_original_stdout�sys�stdoutr3s r�test_get_original_stdoutz$TestSupport.test_get_original_stdoutDs������4�4�6��
�
�Crc��ddl}|jdtj�t	j
d�|j
dtj�y)Nr�sched)rB�assertInr>�modulesr�unload�assertNotIn)r'rBs  r�test_unloadzTestSupport.test_unloadHs9����
�
�g�s�{�{�+����W�%�����#�+�+�.rc��ttdd��5}	ddd�tjt�|j	t
jjt��tjt�y#1swY�nxYw)Nr)�utf-8��encoding)�open�TESTFNr�unlink�assertFalse�os�path�exists)r'�fs  r�test_unlinkzTestSupport.test_unlinkNs_��
�&�#��
0�	�A��	����� ����������/�0����� �		�	�s�B�Bc���tjdz}tjj	|d�}tj
|�tj
|�tj|�|jtjj|��tjtdd�5tj|�ddd�tj
|�tj
|�tj|tjtjz�tjtdd�5tj|�ddd�|jtjj|��tj
|�tj
|�tj|d�tjtdd�5tj|�ddd�|jtjj|��y#1swY��xxYw#1swY��xYw#1swY�QxYw)N�d�subdir�verboser)rrMrPrQ�join�mkdir�rmtreerOrRr�	swap_attr�chmod�stat�S_IRUSR�S_IXUSR)r'�dirpath�
subdirpaths   r�test_rmtreezTestSupport.test_rmtreeUs����"�"�S�(���W�W�\�\�'�8�4�
�
�����
���������!����������0�1�
�
�
�w�	�1�
5�	&����W�%�	&�	�����
�����
����$�,�,�t�|�|�3�4�
�
�
�w�	�1�
5�	&����W�%�	&����������0�1�
�����
�����
����!��
�
�
�w�	�1�
5�	&����W�%�	&����������0�1�	&�	&��	&�	&��	&�	&�s$�<I�I�;I!�I�I�!I*c���tdz}t|dd��5}td|��ddd�tjjdtj�tj�	tt�}|jttj�tjt�|jttj�tjd=t!j"|�t!j$d�y#1swY��xYw#tjd=t!j"|�t!j$d�wxYw)	Nz.pyr)rIrJzfoo = 1��filer�__pycache__)rMrL�printr>rQ�insertrP�curdir�	importlib�invalidate_caches�
__import__rCrDr�forgetrFrrNr[)r'�mod_filenamerS�mods    r�test_forgetzTestSupport.test_forgetms�����~��
�,��g�
6�	%�!��)�!�$�	%�������2�9�9�%��#�#�%�		,��V�$�C��M�M�&�#�+�+�.�� � ��(����V�S�[�[�1���������\�*����]�+�	%�	%����������\�*����]�+�s�D�1A0D)�D&�)=E&c�n�tjtjdf�}|j	�y)Nr)�socket�
create_serverr�HOST�close�r'�ss  r�	test_HOSTzTestSupport.test_HOST~s&��� � �-�"4�"4�a�!8�9��	���	rc��tj�}tjtj|f�}|j�yr<)r�find_unused_portrsrtrurv)r'�portrxs   r�test_find_unused_portz!TestSupport.test_find_unused_port�s4���-�-�/��� � �-�"4�"4�d�!;�<��	���	rc��tj�}tj|�|j�|j	�yr<)rsr�	bind_port�listenrvrws  r�test_bind_portzTestSupport.test_bind_port�s-���M�M�O������"�	���
�	���	rc��tj�}tjj	|�}	tjj|d�}|j
tjj|��tj|�5}|j||�|jtjj|��ddd�|j
tjj|��tj|�y#1swY�MxYw#tj|�wxYw)z8Test that temp_dir() creates and destroys its directory.�tempN)
�tempfile�mkdtemprPrQ�realpathrYrO�isdirr�temp_dirr&�
assertTruer[)r'�
parent_dirrQ�	temp_paths    r�
test_temp_dirzTestSupport.test_temp_dir�s����%�%�'�
��W�W�%�%�j�1�
�	)��7�7�<�<�
�F�3�D����R�W�W�]�]�4�0�1��#�#�D�)�
5�Y�� � ��D�1�������
�
�d� 3�4�
5�
���R�W�W�]�]�4�0�1����Z�(�
5�
5��

���Z�(�s%�A#D1�AD%�6D1�%D.�*D1�1Ec��tj�5}|jtjj|��ddd�|j
tjj��y#1swY�8xYw)zTest passing no path.N)rr�r�rPrQr�rO)r'r�s  r�test_temp_dir__path_nonez$TestSupport.test_temp_dir__path_none�sY��
�
�
�
!�	6�Y��O�O�B�G�G�M�M�)�4�5�	6���������y�1�2�	6�	6�s�/A;�;Bc��d�}tj�}tjj	|�}	|jtjj
|��|jt||�|jtjj
|��tj|�y#tj|�wxYw)z-Test passing a directory that already exists.c�\�tj|�5}td��#1swYyxYw�Nzshould not get here)rr��	Exception)rQr�s  r�
call_temp_dirzMTestSupport.test_temp_dir__existing_dir__quiet_default.<locals>.call_temp_dir�s.���#�#�D�)�
7�Y�� 5�6�6�
7�
7���"�+N)r�r�rPrQr�r�r�r0�FileExistsError�shutilr[)r'r�rQs   r�*test_temp_dir__existing_dir__quiet_defaultz6TestSupport.test_temp_dir__existing_dir__quiet_default�s���	7����!���w�w����%��	 ��O�O�B�G�G�M�M�$�/�0����o�}�d�C��O�O�B�G�G�M�M�$�/�0��M�M�$���F�M�M�$��s�A3C�Cc���tj�}tjj	|�}	tj�5}tj|d��5}|j||�ddd�|jD�cgc]}t|j���}}ddd�|jtjj|��tj |�|jt#�d|�|d}|j|j%d|�d��|�y#1swY��xYwcc}w#1swY��xYw#tj |�wxYw)z=Test passing a directory that already exists with quiet=True.T��quietN�rz5tests may fail, unable to create temporary directory �: )r�r�rPrQr�r�check_warningsrr�r&rr$r%r�r�r�r[r�
startswith)r'rQ�recorderr�r)rr"s       r�'test_temp_dir__existing_dir__quiet_truez3TestSupport.test_temp_dir__existing_dir__quiet_true�s,�����!���w�w����%��	 � �/�/�1�
G�X��'�'��D�9�6�Y��$�$�T�9�5�6�4<�4E�4E�F�q�C��	�	�N�F��F�
G�

�O�O�B�G�G�M�M�$�/�0��M�M�$������X���8�4���{��������+?�?C�h�b�)J�K��	�6�6��F�
G�
G��
�M�M�$��sG�E�	E�!D:�4E�
E�&E�(6E�:E	�?E�E�E�E.c�V�tjdtjd��y)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�dedentr3s r�test_temp_dir__forked_childz'TestSupport.test_temp_dir__forked_child�s$��
	�&�&�t�X�_�_�>�.
�	rc��tj�}tj�5}tj|�5}|j||�|jtj�|�ddd�ddd�|jtj�|�y#1swY�6xYw#1swY�:xYwr<)rP�getcwdrr��
change_cwdr&)r'�original_cwdr��new_cwds    r�test_change_cwdzTestSupport.test_change_cwd�s����y�y�{��
�
�
�
!�	7�Y��%�%�i�0�
7�G�� � ��)�4�� � �����g�6�
7�	7�
	
�������l�3�	
7�
7��	7�	7�s"�B7�7B+�6B7�+B4	�0B7�7Cc�:�tj�}d�}tj�5}tjj|d�}|j
t||�ddd�|jtj�|�y#1swY�.xYw)z&Test passing a non-existent directory.c�\�tj|�5}td��#1swYyxYwr�)rr�r�)rQr�s  r�call_change_cwdzFTestSupport.test_change_cwd__non_existent_dir.<locals>.call_change_cwd�s.���%�%�d�+�
7�w�� 5�6�6�
7�
7�r��does_not_existN)	rPr�rr�rQrYr0�FileNotFoundErrorr&)r'r�r�r��non_existent_dirs     r�!test_change_cwd__non_existent_dirz-TestSupport.test_change_cwd__non_existent_dir�s{���y�y�{��	7��
�
�
!�	0�Z�!�w�w�|�|�J�8H�I�����/��.�
0�	0�
	
�������l�3�	0�	0�s�8B�Bc���tj�}tj�5}tjj|d�}t
j�5}tj|d��5}|j||�|jtj�|�ddd�|jD�cgc]}t|j���}}ddd�ddd�|jt�d|�|d}|j|jd�d��|�y#1swY��xYwcc}w#1swY�ixYw#1swY�mxYw)	z6Test passing a non-existent directory with quiet=True.r�Tr�Nr�r�Btests may fail, unable to change the current working directory to r�)rPr�rr�rQrYrr�r�r&rr$r%rr�r�)	r'r�r��bad_dirr�r�r)rr"s	         r�-test_change_cwd__non_existent_dir__quiet_truez9TestSupport.test_change_cwd__non_existent_dir__quiet_trues3���y�y�{��
�
�
�
!�	G�Z��g�g�l�l�:�/?�@�G� �/�/�1�
G�X��)�)�'��>�;�'��$�$�W�l�;��$�$�R�Y�Y�[�'�:�;�5=�4E�4E�F�q�C��	�	�N�F��F�	
G�	G�	
����X���8�4���{��������+.�.5�[��)<�=��	�;�;��G�	
G�
G��	G�	G�sG�5E�E	�67D8�-E	�E�E	�!E�8E�=E	�	E	�E�Ec��tdz}tj�5}tj|d��5	ddd�|j
D�cgc]}t
|j���}}ddd�|jt�d|�|d}|j|jd|�d��|�y#1swY��xYwcc}w#1swY�axYw)	z0Check the warning message when os.chdir() fails.�_does_not_existT)rQr�Nr�rr�r�)rMrr�rr�rr$r%r&rr�r�)r'rQr�r)r*�msgs      r�test_change_cwd__chdir_warningz*TestSupport.test_change_cwd__chdir_warnings����)�)��
�
+�
+�
-�	C���%�%�4�t�<�
��
�08�0A�0A�B�1��A�I�I��B�H�B�	C�
	
����X���8�4��q�k��������*-�-1�H�B�(8�9��	�

�
��B�	C�	C�s-�C�B;�C�C�*C�;C	�C�Cc��tj�}tjt��5|jtjjtj��t�ddd�|jtjjt��|jtj�|�y#1swY�`xYw)N��name)
rPr�r�temp_cwdrMr&rQ�basenamerOrR)r'�heres  r�
test_temp_cwdzTestSupport.test_temp_cwd&s����y�y�{��
�
�
�V�
,�	D����R�W�W�-�-�b�i�i�k�:�F�C�	D����������/�0��������d�+�	D�	D�s�AC�Cc��tj�}tjd��5}|j	||�|jtjj|��|jtj�|�ddd�|jtj�|�y#1swY�.xYw)z Test passing None to temp_cwd().Nr�)	rPr�rr��assertNotEqualr�rQr�r&)r'r�r�s   r�test_temp_cwd__name_nonez$TestSupport.test_temp_cwd__name_none.s����y�y�{��
�
�
�T�
*�	3�g������6��O�O�B�G�G�M�M�'�2�3����R�Y�Y�[�'�2�	3�	
�������l�3�		3�	3�s�A%B=�=Cc�V�|jtjdddd��d�y)N�r
r�)r�r
r�z{1: 1, 2: 2, 3: 3})r&r�sortdictr3s r�
test_sortdictzTestSupport.test_sortdict7s$������)�)�Q�!�q�/�:�<P�Qrc��tj�}|jt�5}t	j
|d�ddd�|j
jjtj�y#1swY�>xYw)Nsfoo)
r�make_bad_fdr0�OSErrorrP�writer&�	exception�errno�EBADF)r'�fd�cms   r�test_make_bad_fdzTestSupport.test_make_bad_fd:sa��
�
"�
"�
$��
�
�
�w�
'�	!�2��H�H�R�� �	!�������+�+�U�[�[�9�	!�	!�s�A>�>Bc��tj|ddd��|jt�5tj|d�ddd�y#1swYyxYw)Nz	def classr��)�lineno�offsetzx=1)r�check_syntax_errorr0�AssertionErrorr3s r�test_check_syntax_errorz#TestSupport.test_check_syntax_error@sI���"�"�4��Q�q�I�
�
�
�~�
.�	4��&�&�t�U�3�	4�	4�	4�s�A�Ac��ddl}tjd�5|jd�ddd�y#1swYyxYw)Nr�pprint)rkr�CleanImportr/)r'rks  r�test_CleanImportzTestSupport.test_CleanImportEs8���
�
&�
&�x�
0�	.�#�I�#�#�H�-�	.�	.�	.�s�6�?c�Z�tjdd�5|jdtj�|jdtj�ddd�|jdtj�|jdtj�y#1swY�JxYw)Nr.�bar)r�
DirsOnSysPathrCr>rQrFr3s r�test_DirsOnSysPathzTestSupport.test_DirsOnSysPathJsu��
�
(�
(���
6�	+��M�M�%����*��M�M�%����*�	+�	
�������)��������)�		+�	+�s�AB!�!B*c��tj�5}td�ddd�|jj	�d�y#1swY�*xYw)N�hello�hello
)r�captured_stdoutrhr&�getvalue)r'r?s  r�test_captured_stdoutz TestSupport.test_captured_stdoutQsC��
�
$�
$�
&�	�&��'�N�	�������*�I�6�	�	�s�A
�
Ac���tj�5}tdtj��ddd�|jj
�d�y#1swY�*xYw)Nr�rer�)r�captured_stderrrhr>�stderrr&r�)r'r�s  r�test_captured_stderrz TestSupport.test_captured_stderrVsJ��
�
$�
$�
&�	,�&��'��
�
�+�	,�������*�I�6�	,�	,�s�A�A#c���tj�5}|jd�|jd�t	�}ddd�|jd�y#1swY�xYw)Nr�rr�)r�captured_stdinr��seek�inputr&)r'�stdin�captureds   r�test_captured_stdinzTestSupport.test_captured_stdin[sU��
�
#�
#�
%�	���K�K�	�"��J�J�q�M��w�H�		�
	
����7�+�	�	�s�-A�A&c�,�tj�yr<)r�
gc_collectr3s r�test_gc_collectzTestSupport.test_gc_collectcs�����rc�T�|jtj�t�yr<)�assertIsInstancer�python_is_optimized�boolr3s r�test_python_is_optimizedz$TestSupport.test_python_is_optimizedfs�����g�9�9�;�T�Brc��Gd�d�}|�}d|_tj|dd�5}|j|jd�|j|d�ddd�|j|jd�tj|dd�5}|j|jd�|j|�ddd�|j
t|d��tj|dd�5|`ddd�|j
t|d��y#1swY��xYw#1swY�nxYw#1swY�=xYw)Nc��eZdZy)�'TestSupport.test_swap_attr.<locals>.ObjN)r�
__module__�__qualname__�rr�Objr�js��rrr��xr��y)rrr\r&r�assertIsNonerO�hasattr)r'r�objrrs     r�test_swap_attrzTestSupport.test_swap_attris ��	�	��e�����
�
�
�s�C��
+�	#�q����S�U�U�A�&����Q��"�	#�	
�������"�
�
�
�s�C��
+�	!�q����S�U�U�A�&����a� �	!�	
�����c�*�+�
�
�
�s�C��
+�	���	������c�*�+�	#�	#��	!�	!��	�	�s#�/D)�.D5�E�)D2�5D>�E
c�&�ddi}tj|dd�5}|j|dd�|j|d�ddd�|j|dd�tj|dd�5}|j|dd�|j|�ddd�|j	d|�tj|dd�5|d=ddd�|j	d|�y#1swY��xYw#1swY�]xYw#1swY�4xYw)Nrr�r�r)r�	swap_itemr&rrF)r'�Drrs    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� �	#�	#��	!�	!��	�	�s#�(C/�8'C;�D�/C8�;D�Dc��eZdZdZdZdZdZy)�TestSupport.RefClassN)rr�r�
attribute1�
attribute2�_hidden_attribute1�__magic_1__rrr�RefClassr�s���
��
�!���rrc��eZdZdZdZdZdZy)�TestSupport.OtherClassN)rr�rr�
attribute3r�__magic_2__rrr�
OtherClassr�s���
��
����rrc��tj|j|j�}|j	dh|�tj|j|j�}|j	ddh|�y)Nrrr)r�detect_api_mismatchrrr&)r'�
missing_itemss  r�test_detect_api_mismatchz$TestSupport.test_detect_api_mismatch�se���3�3�D�M�M�48�O�O�E�
����,���7��3�3�D�O�O�48�M�M�C�
����,�
�6�
�Frc�$�gd�}tj|j|j|��}|j	t�|�tj|j|j|��}|j	t�|�y)N)rrr�
not_in_either)�ignore)rrrrr&�set)r'rrs   r� test_detect_api_mismatch__ignorez,TestSupport.test_detect_api_mismatch__ignore�si��M���3�3��
�
�t���v�?�
������
�.��3�3�������v�?�
������
�.rc���dh}dh}tj|t||��hd�}hd�}tj|td||��|j	t
tj|t�y)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�r1r0r�)r'r%r&s   r�test_check__all__zTestSupport.test_check__all__�su�����"�|�����T�%�#(�*6�	8�

��F�����T�%�I�$)�*6�	8�	
���.�'�*>�*>��h�Or�waitpid�WNOHANGz need os.waitpid() and os.WNOHANGc���tj�tj�}|dk(rtjd�tj
}	dt_t
j�}tjtj�D]V}tjtjd|�5tj�ddd�tj
s�Vnd|z}|j||j��|jtj
�|t_tj�y#1swY��xYw#|t_wxYw)NrF�orig_stderrz2Warning -- reap_children() reaped child process %s)r�
reap_childrenrP�fork�_exit�environment_altered�io�StringIO�sleeping_retry�
SHORT_TIMEOUTr\�
print_warningrCr�r�)r'�pid�was_alteredr��_r�s      r�test_reap_childrenzTestSupport.test_reap_children�s��
	�����g�g�i���!�8��H�H�Q�K��1�1��	6�*/�G�'��[�[�]�F��+�+�G�,A�,A�B�
���&�&�w�'<�'<�m�V�T�,��)�)�+�,�
�.�.��
�G��L�C��M�M�#�v���0�1��O�O�G�7�7�8�*5�G�'�	����!,�,��+6�G�'�s,�A*E�>E�E�,AE�E	�E�
E,Nc���d|�d|�d�}tjg|�d�|�}tjj	�D��cic]\}}|jd�s||��}}}t
j|tjtjd|��}	|�|}|j|	jj�t|��|j|	jd�ycc}}w)	Nzfrom test.support import z
; print(repr(z()))r��PYTHONT)r?r��universal_newlines�envr)r>�
executablerP�environ�itemsr��
subprocess�run�PIPE�DEVNULLr&r?�rstrip�repr�
returncode)
r'�args�func�expected�code�cmd�key�valuerE�procs
          r�
check_optionszTestSupport.check_options�s���*�4�&�
�d�V�4�H���~�~�1��1�d�1�D�1��,.�J�J�,<�,<�,>�0�j�c�5��n�n�X�.��E�z�0��0��~�~�c�%/�_�_�%/�%7�%7�15�"%�	'��
���H�������+�+�-�t�H�~�>�������!�,��0s�C-�cpuc��gdgdgdgdgdgdgdgdgd	gd
gdgdgd
dggd�d
dgd
dgd
dgd
dgd
dgfD]/}|j|��5|j|d�ddd��1|jgd�dd	g�y#1swY�RxYw)Nz-B�-sz-S�-Ez-vz-b�-Pz-q�-Iz-bbz-vvv�-Wignore�-X�dev)r_r`ra�faulthandler�
importtime�showrefcount�tracemallocz
tracemalloc=3��opts�args_from_interpreter_flags)r^r\r[r]��subTestrX�r'rgs  r� test_args_from_interpreter_flagsz,TestSupport.test_args_from_interpreter_flags�s���

�
�F�
�F�
�F�
�F�
�F�
�F�
�F�
�F�
�F�
�G�
�H�
�L�
�5�M�%�
�>�"�
�<� �
�>�"�
�=�!�
�?�#�3
�	H�D�6���4��(�
H��"�"�4�)F�G�
H�
H�7	H�<	
���3�8� �6�	#�
H�
H�s�A:�:B	c��gdgdgdgfD]/}|j|��5|j|d�ddd��1y#1swY�<xYw)Nz-Oz-OOz-OOOOrf�!optim_args_from_interpreter_flagsrirks  r�&test_optim_args_from_interpreter_flagsz2TestSupport.test_optim_args_from_interpreter_flagssi��
�
�F�
�G�
�I�
�	N�D����4��(�
N��"�"�4�)L�M�
N�
N�	N�
N�
N�s	�=�A	zUnstable in EmscriptenzUnavailable on WASIc�.�tj�}tjttj
�}	tj�}tj|�|j||z
d�y#tj|�wxYw�Nr�)r�fd_countrPrL�__file__�O_RDONLYrvr&)r'�startr��mores    r�
test_fd_countzTestSupport.test_fd_count)sg���"�"�$��
�W�W�X�r�{�{�
+��	��%�%�'�D��H�H�R�L�������q�)��
�H�H�R�L�s�A=�=Bc�
�tj�}tjtjd|�5tj|�ddd�|j|j
�|�y#1swY�*xYw)Nr4)r9r:rr\r=r&r�)r'r�rRr�s    r�check_print_warningzTestSupport.check_print_warning9s_�������
�
�
�w�4�4�m�V�
L�	'��!�!�#�&�	'�������*�H�5�	'�	'�s�A9�9Bc�L�|jdd�|jdd�y)Nr�zWarning -- msg
za
bzWarning -- a
Warning -- b
)ryr3s r�test_print_warningzTestSupport.test_print_warning?s)��� � ��!3�	5�� � ��!?�	Arc���tjstjdk(r |j	tj
�y|j
tj
�y)N�win32)r�
is_emscriptenr>�platformrO�has_strftime_extensionsr�r3s r�test_has_strftime_extensionsz(TestSupport.test_has_strftime_extensionsEs<��� � �C�L�L�G�$;����W�<�<�=��O�O�G�;�;�<rc�Z�tjd�}tjd|�y)Nap
            from test import support
            import sys

            def check(cond):
                if not cond:
                    raise AssertionError("test failed")

            # depth 1
            check(support.get_recursion_depth() == 1)

            # depth 2
            def test_func():
                check(support.get_recursion_depth() == 2)
            test_func()

            def test_recursive(depth, limit):
                if depth >= limit:
                    # cannot call get_recursion_depth() at this depth,
                    # it can raise RecursionError
                    return
                get_depth = support.get_recursion_depth()
                print(f"test_recursive: {depth}/{limit}: "
                      f"get_recursion_depth() says {get_depth}")
                check(get_depth == depth)
                test_recursive(depth + 1, limit)

            # depth up to 25
            with support.infinite_recursion(max_depth=25):
                limit = sys.getrecursionlimit()
                print(f"test with sys.getrecursionlimit()={limit}")
                test_recursive(2, limit)

            # depth up to 500
            with support.infinite_recursion(max_depth=500):
                limit = sys.getrecursionlimit()
                print(f"test with sys.getrecursionlimit()={limit}")
                test_recursive(2, limit)
        r�)r�r�rr�)r'rSs  r�test_get_recursion_depthz$TestSupport.test_get_recursion_depthKs(�����& �&
��N	�&�&�t�T�2rc����fd��dD]Y}tj|�5tj�}�|�	�|dz�|jd�ddd��[tjd�5	�d�|jd�ddd�y#t$rY�NwxYw#1swY��xYw#t$rY�/wxYw#1swYyxYw)Nc�"��|r�|dz
�yyrqr)�depth�recursive_functions �rr�z6TestSupport.test_recursion.<locals>.recursive_functionxs����"�5�1�9�-�r)r���r�zRecursionError was not raisedr�)r�infinite_recursion�get_recursion_available�fail�RecursionError)r'�	max_depth�	availabler�s   @r�test_recursionzTestSupport.test_recursionvs����	.�&�	?�I��+�+�I�6�
?�#�;�;�=�	�#�9�-�
?�&�y�1�}�5��I�I�=�>�
?�
?�	?�$�
'�
'��
*�	;�
;�"�1�%��	�	�9�:�
	;�	;��
&�����
?�
?��("�
��
��	;�	;�s^�B-�B�
B-�:C�<B9�C�	B*�'B-�)B*�*B-�-B6	�9	C�C�C�C�Cc�,�tj}d}|dz}|dz}|dz}|j|d�d�|j|d�d|z�|j|d�td|z��|j|d�td	|z��|j|d
�|�dD]C}|j	|��5|jt�5||�ddd�ddd��Ey#1swY�xYw#1swY�\xYw)
Ni�0kr�3kr�z2.4mg333333@�4g��1t)��3z3.5.10k�10x)�limit)r�_parse_memlimitr&�intrjr0�
ValueError)r'�parse�KiB�MiB�GiB�TiBr�s       r�test_parse_memlimitzTestSupport.test_parse_memlimit�s���'�'�����D�j���D�j���D�j������t��a�(�����t��a�#�g�.�����v���C�#�I��7�����t��c�!�c�'�l�3�����t��c�*�0�	!�E����E��*�
!��&�&�z�2�!��%�L�!�
!�
!�	!�!�!��
!�
!�s$�D
�"	C>�+D
�>D�D
�
D	c�*�d}d}tj}tj}	tjdkDr�tj
d�|j
tj|�|j
tj|�ddz|z}tj
|�d��|j
tjtj�|j
tj||z�nctj
d�|j
tjtj�|j
tj|�|t_|t_y#|t_|t_wxYw)Nllr�r
�d�t)r�
max_memuse�real_max_memuser>�maxsize�set_memlimitr&)r'�_4GiBr��old_max_memuse�old_real_max_memuse�bigs      r�test_set_memlimitzTestSupport.test_set_memlimit�s%������ �+�+��%�5�5��	:��{�{�U�"��$�$�T�*�� � ��!3�!3�U�;�� � ��!8�!8�%�@���f��m���$�$��u�A�Y�/�� � ��!3�!3�S�[�[�A�� � ��!8�!8�#��)�D��$�$�T�*�� � ��!3�!3�S�[�[�A�� � ��!8�!8�%�@�!/�G��&9�G�#��"0�G��&9�G�#�s�D=E:�:Fc��tjd�}|stjd�}tjj	|�}tjj|�s|j
d|���tjj|d�}tjj|�s|j
d|�d��ddh}tj|�}|jtj||�|dhz�tjj|d	�}|jtj|tj|��|dd
hz�tjj|d�}|jtj|tj|��|�y)N�
abs_srcdir�srcdirz,cannot access Python source code directory: �Modulesz landmark is missingz.gitrg�build�Doc�venv�Objects)�	sysconfig�get_config_varrPrQ�abspathrR�skipTestrY�listdirr&r�copy_python_src_ignore)r'�src_dir�landmark�ignored�namesrQs      r�test_copy_python_src_ignorez'TestSupport.test_copy_python_src_ignore�sr���*�*�<�8����.�.�x�8�G��'�'�/�/�'�*���w�w�~�~�g�&��M�M��%�[�*�
+��7�7�<�<���3���w�w�~�~�h�'��M�M��&�\�)=�?�
@��=�)���
�
�7�#������7�7���G� �G�9�,�	.��w�w�|�|�G�U�+������7�7��b�j�j��>N�O� �G�V�#4�4�	6��w�w�|�|�G�Y�/������7�7��b�j�j��>N�O� �	"rr<)Hrr�r�classmethodrrr+r4r7r9r1�skipr@rGrTrcrqr�requires_working_socketryr}r�r�r�r�r��
requires_forkr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr!r0�
skipUnlessrrPrA�requires_subprocessrX�requires_resourcerlro�skipIfr~�is_wasirwryr{r�r�r�r�r�r�rrrr
r
s����<��<��<��<�5�>�
4�Q�
�X�]�]�&�'�D�(�D�/�!�2�0,�"%�W�$�$�&��'��%�W�$�$�&��'��
%�W�$�$�&��'��
)�3� � �*�W�������44�
4��*
�",�4�R�:�4�
.�
*�7�
7�
,��C�,�"!�����G�	/�P�6�X�����Y�/�J�G�B�	�4J�;�=��W����  ��=�  �D!�W� � �"�
-�#�
-��W���u�%�"#�&�"#�H
N��X�_�_�W�*�*�,D�E��X�_�_�W�_�_�&;�<�*�=�F�*�6�A�=�)3�V;�@!�":�.""rr
�__main__)r�rkr9rPr�rsr^rIr>r�r�r�r1r�testr�test.supportrrrrrrM�TestCaser
r�mainrrr�<module>r�s{����	�	�
�
���
�������&�"�&�&�(�	�	�	��F"�(�#�#�F"�|�z���H�M�M�O�r

Zerion Mini Shell 1.0