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/idlelib/idle_test/__pycache__/test_run.cpython-311.opt-1.pyc
�

��Vc�>���dZddlmZddlZddlZddlmZmZddlZddlm	Z	ddlZddl
mZde_Gd�d	ej
��ZGd
�de��ZGd�d
��ZGd�dej
��ZGd�dej
��ZGd�dej
��ZGd�dej
��ZGd�dej
��Zedkrejd���dSdS)zTest run, coverage 54%.�)�runN)�captured_output�captured_stderr)�mock)�FuncTc��eZdZd�ZdedfdedfdedffZd�Ze	j
�ed	d
����d���Z
d
S)�
ExceptionTestc	��Gd�dt��}|d��}|d��}	||�#|$r�	|�#|$r�t��5}tj�t
d��5}d�|_tj��ddd��n#1swxYwYddd��n#1swxYwYYnwxYwYnwxYw|����	���
��}|�dt|����|�
d|d	��|�
d
|d��dS)Nc��eZdZd�ZdS)�JExceptionTest.test_print_exception_unhashable.<locals>.UnhashableExceptionc��dS)NT�)�self�others  �.D:\Python311\Lib\idlelib\idle_test\test_run.py�__eq__zQExceptionTest.test_print_exception_unhashable.<locals>.UnhashableException.__eq__s���t�N)�__name__�
__module__�__qualname__rrrr�UnhashableExceptionrs#������
�
�
�
�
rr�ex1�ex2�cleanup_tracebackc��|S�Nr��t�es  r�<lambda>z?ExceptionTest.test_print_exception_unhashable.<locals>.<lambda> s��a�r�zUnhashableException: ex2�zUnhashableException: ex1�
)�	Exceptionrr�patch�objectr�side_effect�print_exception�getvalue�strip�
splitlines�assertEqual�len�assertIn)rrrr�output�ct�tbs       r�test_print_exception_unhashablez-ExceptionTest.test_print_exception_unhashables���	�	�	�	�	�)�	�	�	�"�!�%�(�(��!�!�%�(�(��		.��3���"�	.�	.�	.�
.��	��&�
.�
.�
.�$�&�&�.�&���*�*�3�0C�D�D�.��)7�����+�-�-�-�.�.�.�.�.�.�.�.�.�.�.����.�.�.�.�.�.�.�.�.�.�.�.�.�.�.����.�.�.�.���
.������	.�����_�_�
�
�
$�
$�
&�
&�
1�
1�
3�
3������S��W�W�%�%�%��
�
�0�"�Q�%�8�8�8��
�
�0�"�R�&�9�9�9�9�9sr�.�C�6�B<�	&B.�/B	�B.�B
�B.�B
�B.�"B<�.B2�2B<�5B2�6B<�9C�;B<�<C�C�1/0zdivision by zero
�abcz0name 'abc' is not defined. Did you mean: 'abs'?
zint.reelzAtype object 'int' has no attribute 'reel'. Did you mean: 'real'?
c	�~�|jD]�\}}}|�|���5	tt|dd����n`#|$rXt	j��\}}}t
j|||��d}|j�d|��}|�	||��YnwxYwddd��n#1swxYwY��dS)N)�code��evalrz: )
�data�subTestr8�compile�sys�exc_infor�get_message_linesrr,)	rr6�exc�msg�typ�valr1�actual�expects	         r�test_get_messagezExceptionTest.test_get_message0s%��"�i�	5�	5�N�D�#�s����4��(�(�
5�
5�5����r�6�2�2�3�3�3�3���5�5�5�#&�<�>�>�L�C��b� �2�3��R�@�@��C�F� #��5�5��5�5�F��$�$�V�V�4�4�4�4�4�	5����
5�
5�
5�
5�
5�
5�
5�
5�
5�
5�
5����
5�
5�
5�
5��	5�	5s5�B1�A�B1�AB"�B1�!B"�"B1�1B5	�8B5	rc��d�S)Nc��dSrrrs  rr z(ExceptionTest.<lambda>.<locals>.<lambda><s��$�rrrrrr zExceptionTest.<lambda><s
��->�->�r��new_callablec
���|j}|d|df|d|df|d|dff}d}|D�]\\}}}\}}	}
|�||f���5	tt|dd����n�#|$r�	tt|dd����n�#|	$r�t	��5}tj��ddd��n#1swxYwY|���}|�||��|�|
|��|dz
}YnwxYwYnwxYwddd��n#1swxYwY��|�	|t|����dS)Nr��)�codesr7r8)r9r:r8r;rrr(r)r.r,r-)
rr�d�data2�subtests�code1�exc1�msg1�code2�exc2�msg2r/rCs
             r�test_get_multiple_messagez'ExceptionTest.test_get_multiple_message;s!��
�I���A�$��!����!��a��d�|�a��d�A�a�D�\�:����8=�
	&�
	&�4��U�D�$�!4�%��t����U�5�M��2�2�
&�
&�&�����F�3�3�4�4�4�4���	&�	&�	&�&��W�U�B��7�7�8�8�8�8���&�&�&�,�.�.�2�&��/�1�1�1�2�2�2�2�2�2�2�2�2�2�2����2�2�2�2�!'���!2�!2���
�
�d�F�3�3�3��
�
�d�F�3�3�3� �A�
����
&������	&����
&�
&�
&�
&�
&�
&�
&�
&�
&�
&�
&����
&�
&�
&�
&��	
����3�u�:�:�.�.�.�.�.s�!E�#B�E�D3�B'�&D3�'D-	�:C�D-	�C�D-	�!C�"AD-	�*D3�,D-	�-D3�0E�2D3�3E�E	�	E	N)rrrr2�ZeroDivisionError�	NameError�AttributeErrorr9rErr%r&rrWrrrr	r	s�������:�:�:�.�%�';�<�
�I� 8�
9�
��+�
,��D�	5�	5�	5�
�Z���s�/�$?�$?��A�A�/�/�A�A�/�/�/rr	c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�Sc�0�dt|��jzS)Nz%s:str��typer�rs r�__str__z	S.__str__Ts���$�t�*�*�-�-�-rc�0�dt|��jzS)Nz
%s:unicoder^r`s r�__unicode__z
S.__unicode__Vs���d�4�j�j�1�1�1rc��dS�Nr"rr`s r�__len__z	S.__len__Xs���qrc� �td��S)Nr4)�iterr`s r�__iter__z
S.__iter__Zs���E�{�{�rc�0�dt|��jzS)Nz%s:itemr^�r�argss  r�__getitem__z
S.__getitem__\s���4��:�:�.�.�.rc�0�dt|��jzS)Nz%s:slicer^rks  r�__getslice__zS.__getslice__^s���D��J�J�/�/�/rN)	rrrrarcrfrirmrorrrr\r\Ssn������.�.�.�2�2�2�������/�/�/�0�0�0�0�0rr\c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�	MockShellc�.�|���dSr)�resetr`s r�__init__zMockShell.__init__cs���
�
�����rc�:�|j�|��dSr)�written�appendrks  r�writezMockShell.writees������D�!�!�!�!�!rc�4�|j���Sr)�lines�popr`s r�readlinezMockShell.readlinegs���z�~�~���rc��dSrrr`s r�closezMockShell.closeis���rc��g|_dSr)rvr`s rrszMockShell.resetks
������rc�@�t|��ddd�|_dS)N���)�listrz)rrzs  r�pushzMockShell.pushms���%�[�[���2��&��
�
�
rN)	rrrrtrxr|r~rsr�rrrrqrqbsn���������"�"�"� � � �
�
�
����'�'�'�'�'rrqc�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�StdInputFilesTestc���t��}tj|d��}|�|tj��|�|jd��|�|jd��|�	|j
��|�|jd��|�|j
��|�|�����|�|�����|�|�����|�|�����dS)N�stdin�utf-8�strictz<stdin>)rqr�StdInputFile�assertIsInstance�io�
TextIOBaser,�encoding�errors�assertIsNone�newlines�name�assertFalse�closed�
assertTrue�isatty�readable�writable�seekable�r�shell�fs   r�	test_misczStdInputFilesTest.test_miscss��������U�G�,�,�����a���/�/�/������W�-�-�-������8�,�,�,����!�*�%�%�%�������+�+�+������"�"�"�������
�
�#�#�#�����
�
���%�%�%���������&�&�&���������&�&�&�&�&rc��t��}tj|d��}|�t|j��|�t|j��|�t|jd��|�t|jd��|�t|j	dg��dS)Nr�r�x)
rqrr��assertRaises�OSError�fileno�tell�seekrx�
writelinesr�s   r�test_unsupportedz"StdInputFilesTest.test_unsupported�s���������U�G�,�,�����'�1�8�,�,�,����'�1�6�*�*�*����'�1�6�1�-�-�-����'�1�7�C�0�0�0����'�1�<�#��7�7�7�7�7rc�6�t��}tj|d��}|�gd���|�|���d��|�gd���|�|�d��d��|�gd���|�|�d��d��|�gd���|�|�d��d��|�|�d��d	��|�|�d
��d��|�dd
g��|�|�d��d��|�t|jd��|�t|jd��|�t|jdd��dS)Nr���one
�two
r7�one
two
r�)r�r��three
r7rL�onr"ze
tr#z	wo
three
r�r�rr7��?�1rK)rqrr�r�r,�readr��	TypeErrorr�s   r�	test_readzStdInputFilesTest.test_read�s���������U�G�,�,��
�
�
�)�)�)�*�*�*���������<�0�0�0�
�
�
�)�)�)�*�*�*����������\�2�2�2�
�
�
�)�)�)�*�*�*����������|�4�4�4�
�
�
�4�4�4�5�5�5����������D�)�)�)����������F�+�+�+����������]�3�3�3�
�
�
�G�W�%�&�&�&����������B�'�'�'����)�Q�V�S�1�1�1����)�Q�V�S�1�1�1����)�Q�V�Q��2�2�2�2�2rc���t��}tj|d��}|�gd���|�|���d��|�|�d��d��|�|�d��d��|�dg��|�|���d��|�|���d��|�gd���|�|���d	��|�|���d
��|�gd���|�|�d��d
��|�|�d��d��|�|�d��d��|�|�d��d��|�ddg��|�|�d��d��|�t|jd��|�t|jd��|�t|jdd��dS)Nr�)r�r�r�zfour
r�r�r�r�r�)�one�two�threer�r�)r�r�r�rLr�rKr�
r#rr7r�r�)	rqrr�r�r,r|r�r��	readlinesr�s   r�
test_readlinezStdInputFilesTest.test_readline�sa��������U�G�,�,��
�
�
�:�:�:�;�;�;���������w�/�/�/�������B����1�1�1�������D�)�)�9�5�5�5�
�
�
�L�>�"�"�"���������w�/�/�/���������w�/�/�/�
�
�
�*�*�*�+�+�+���������u�-�-�-���������u�-�-�-�
�
�
�0�0�0�1�1�1�������A����-�-�-�������A����,�,�,�������A����-�-�-�������B����1�1�1�
�
�
�G�W�%�&�&�&�������A����+�+�+����)�Q�[�#�6�6�6����)�Q�[�#�6�6�6����)�Q�[�!�Q�7�7�7�7�7rc�V�t��}tj|d��}|�gd���|�|���ddg��|�gd���|�|�d��ddg��|�gd���|�|�d��ddg��|�gd���|�|�d��ddg��|�gd���|�|�d��dg��|�gd���|�|�d��ddg��|�gd���|�t|jd	��|�t|jd
��|�t|jdd��dS)Nr�r�r�r�r�rr"�r�r�rK)rqrr�r�r,r�r�r�r�s   r�test_readlinesz StdInputFilesTest.test_readlines�s���������U�G�,�,��
�
�
�)�)�)�*�*�*����������'�(:�;�;�;�
�
�
�)�)�)�*�*�*�������R���7�G�*<�=�=�=�
�
�
�)�)�)�*�*�*�������T�*�*�W�g�,>�?�?�?�
�
�
�)�)�)�*�*�*�������Q���'�7�);�<�<�<�
�
�
�)�)�)�*�*�*�������Q���'��3�3�3�
�
�
�)�)�)�*�*�*�������Q���'�7�);�<�<�<�
�
�
�)�)�)�*�*�*����)�Q�[�#�6�6�6����)�Q�[�#�6�6�6����)�Q�[�!�Q�7�7�7�7�7rc���t��}tj|d��}|�gd���|�|j��|�|���d��|���|�|j��|�|���d��|�	t|jd��dS)Nr�r�r�r�rK)rqrr�r�r�r�r,r|r~r�r�r�s   r�
test_closezStdInputFilesTest.test_close�s���������U�G�,�,��
�
�
�)�)�)�*�*�*������"�"�"���������w�/�/�/�	���	�	�	������"�"�"���������w�/�/�/����)�Q�W�a�0�0�0�0�0rN)	rrrr�r�r�r�r�r�rrrr�r�qsn������'�'�'�8�8�8�3�3�3�(8�8�8�28�8�8�*	1�	1�	1�	1�	1rr�c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�StdOutputFilesTestc���t��}tj|d��}|�|tj��|�|jd��|�|jd��|�	|j
��|�|jd��|�|j
��|�|�����|�|�����|�|�����|�|�����dS)N�stdoutr�r�z<stdout>)rqr�
StdOutputFiler�r�r�r,r�r�r�r�r�r�r�r�r�r�r�r�r�s   rr�zStdOutputFilesTest.test_misc�s��������e�X�.�.�����a���/�/�/������W�-�-�-������8�,�,�,����!�*�%�%�%�������,�,�,������"�"�"�������
�
�#�#�#���������&�&�&�����
�
���%�%�%���������&�&�&�&�&rc��t��}tj|d��}|�t|j��|�t|j��|�t|jd��|�t|jd��|�t|j	d��dS)Nr�r)
rqrr�r�r�r�r�r�r�r|r�s   rr�z#StdOutputFilesTest.test_unsupported�s���������e�X�.�.�����'�1�8�,�,�,����'�1�6�*�*�*����'�1�6�1�-�-�-����'�1�6�1�-�-�-����'�1�:�q�1�1�1�1�1rc� �t��}tj|d��}|�d��|�|jdg��|���|�d��|�|jdg��|���|�td����|�|jdg��|�t|jdd��t��|���|�
t|j��|�|jg��|�
t|jd��|�
t|jd��|�|jg��|�
t|jdd	��|�|jg��dS)
Nr��test�r�r��	tèś𝖙)r�r�r�test�{�spam�rqrr�rxr,rvrsr\r_�strr�r�r�s   r�
test_writezStdOutputFilesTest.test_write�s���������e�X�.�.��	������������);�(<�=�=�=�
���
�
�
�	���'�(�(�(������)L�(M�N�N�N�
���
�
�
�	����)�*�*�+�+�+������)L�(M�N�N�N�����e�m�A�.�q�1�2�2�C�8�8�8�
���
�
�
����)�Q�W�-�-�-�������+�+�+����)�Q�W�g�6�6�6����)�Q�W�c�2�2�2�������+�+�+����)�Q�W�f�f�=�=�=�������+�+�+�+�+rc��t��}tj|ddd��}|�d��|�|jdg��|���|�td����|�|jdg��|�t|jdd��t��|���|�
t|j��|�|jg��|�
t|jd��|�
t|jd��|�|jg��|�
t|jd	d
��|�|jg��dS)N�stderrziso-8859-15�backslashreplaceutèś𝖙¤)utè\u015b\U0001d599\xa4r�rr�r�r�r�r�r�s   r�test_write_stderr_nonencodablez1StdOutputFilesTest.test_write_stderr_nonencodables���������e�X�}�>P�Q�Q��	���+�,�,�,������)S�(T�U�U�U�
���
�
�
�	����-�.�.�/�/�/������)S�(T�U�U�U�����e�m�A�.�q�1�2�2�C�8�8�8�
���
�
�
����)�Q�W�-�-�-�������+�+�+����)�Q�W�g�6�6�6����)�Q�W�c�2�2�2�������+�+�+����)�Q�W�f�f�=�=�=�������+�+�+�+�+rc�2�t��}tj|d��}|�g��|�|jg��|���|�ddg��|�|jddg��|���|�ddg��|�|jdd	g��|���|�td
��g��|�|jdg��|�t|jdd��t��|���|�
t|j��|�|jg��|�
t|jd
��|�|jg��|�
t|jdg��|�
t|jd
g��|�|jg��|�
t|jgg��|�|jg��dS)Nr�r�r�)r�r�)r�r��onè
�twò)r�r�)r�r��tèst)r�r�rr�r�)rqrr�r�r,rvrsr\r_r�r�r�r�s   r�test_writelinesz"StdOutputFilesTest.test_writelinessE��������e�X�.�.��	���R����������+�+�+�
���
�
�
�	���g�u�%�&�&�&������-�/@�A�	C�	C�	C�
���
�
�
�	���j�(�+�,�,�,������0�2F�G�	I�	I�	I�
���
�
�
�	���a�	�l�l�^�$�$�$������)>�(?�@�@�@�����e�m�A�.�q�1�2�2�C�8�8�8�
���
�
�
����)�Q�\�2�2�2�������+�+�+����)�Q�\�3�7�7�7�������+�+�+����)�Q�\�G�9�=�=�=����)�Q�\�C�5�9�9�9�������+�+�+����)�Q�\�2�r�:�:�:�������+�+�+�+�+rc���t��}tj|d��}|�|j��|�d��|���|�|j��|�t|jd��|�
|jdg��|���|�t|jd��dS)Nr�r�r�r�rK)
rqrr�r�r�rxr~r�r��
ValueErrorr,rvr�r�s   rr�zStdOutputFilesTest.test_close:s���������e�X�.�.�������"�"�"�	�������	���	�	�	������!�!�!����*�a�g�s�3�3�3������);�(<�=�=�=�	���	�	�	����)�Q�W�a�0�0�0�0�0rN)	rrrr�r�r�r�r�r�rrrr�r��sn������'�'�'�2�2�2�,�,�,�.,�,�,�(,�,�,�<
1�
1�
1�
1�
1rr�c�&�eZdZd�Zd�Zd�Zd�ZdS)�RecursionLimitTestc�.�tj��|�tj��tj}|�t|d���|�t|dd��|�t|d��dS)N�d)�limiti�r)	r�install_recursionlimit_wrappers�
addCleanup�!uninstall_recursionlimit_wrappersr<�setrecursionlimitr�r�r�)rr�s  r� test_bad_setrecursionlimit_callsz3RecursionLimitTest.test_bad_setrecursionlimit_callsJs����+�-�-�-�����=�>�>�>��!�����)�Q�c��2�2�2����)�Q��T�2�2�2����*�a��+�+�+�+�+rc�V�tj��|�tj��t	j��}|�tj|��t	j|dz��t	j��}|�||dz��dSre)rr�r�r�r<�getrecursionlimitr�r,�r�
orig_reclimit�new_reclimits   r�test_roundtripz!RecursionLimitTest.test_roundtripRs����+�-�-�-�����=�>�>�>��-�/�/�
�����-�}�=�=�=���m�a�/�0�0�0��,�.�.������}�q�'8�9�9�9�9�9rc���tj��}tj��|�tj��tj��}|�||��dSr)r<r�rr�r�r�r,r�s   r�&test_default_recursion_limit_preservedz9RecursionLimitTest.test_default_recursion_limit_preserved_s^���-�/�/�
��+�-�-�-�����=�>�>�>��,�.�.������}�5�5�5�5�5rc���d�}tj|d��|�|jd��d|_tj|d��|�|jd��dS)Nc��dS)�	docstringNrrrr�funcz,RecursionLimitTest.test_fixdoc.<locals>.funch����r�morezdocstring

more)r�fixdocr,�__doc__)rr�s  r�test_fixdoczRecursionLimitTest.test_fixdocfsm������
�4�� � � ������':�;�;�;�����
�4�� � � ������v�.�.�.�.�.rN)rrrr�r�r�r�rrrr�r�GsP������,�,�,�:�:�:�6�6�6�/�/�/�/�/rr�c��eZdZd�ZdS)�HandleErrorTestc�@�|j}td��5}tjdt���5}	t
�#t
$r$tj�ddd��YnwxYw|tj	d��dt_	||�
��d��	t�#t$r$tj�ddd��YnwxYw|tjd��dt_|�
��}|�
d|��|�
d|��|�
d	|��||jd
��ddd��n#1swxYwYddd��dS#1swxYwYdS)N�
__stderr__z!idlelib.run.thread.interrupt_mainrHr4�123TFr7�
IndexErrorrL)r,rrr%r�EOFErrorr�MyRPCServer�handle_error�exit_nowr)r��quittingr.�called)r�eq�errr�r@s     r�test_fatal_errorz HandleErrorTest.test_fatal_errorrs+��
�
��
�\�
*�
*�	�c�
�Z�;�%)�+�+�+�	�.2�
A�����
A�
A�
A���,�,�T�5�%�@�@�@�@�@�
A�����B�s�|�T�"�"�"� �C�L��B�s�|�|�~�~�r�"�"�"�
A� � ���
A�
A�
A���,�,�T�5�%�@�@�@�@�@�
A�����B�s�|�T�"�"�"� �C�L��,�,�.�.�C��M�M�%��%�%�%��M�M�%��%�%�%��M�M�,��,�,�,��B�t�{�A����+	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	so�F�E;�<�+A*�'E;�)A*�*AE;�.B5�5+C#� E;�"C#�#BE;�/F�;E?	�?F�E?	�F�F�FN)rrrrrrrr�r�ps#����������rr�c�@�eZdZed���Zed���Zd�ZdS)�ExecRuncodeTestc�2�|�ttdtj��t	��|_|jt_t
j��}t	d���|j_	tj
|��|_dS)Nr(F)�result)�addClassCleanup�setattrrr(r�prtr�Mock�console�getvar�	Executive�ex)�cls�mockrpcs  r�
setUpClasszExecRuncodeTest.setUpClass�sj�����G�C�(9�#�:M�N�N�N��&�&���!�g����)�+�+��!%�U�!3�!3�!3������w�'�'����rc��dSrr)rs r�
tearDownClasszExecRuncodeTest.tearDownClass�r�rc�f�|j}|�d��|�|jdt��|�ttdtj��d�t_	|�d��|�|j
jdt��d�t_	|�d��|j\}}}|�|t��|�
t|jt����dS)Nr3r�
excepthookc�*�tj|��Sr)rr()rrr1s   rr z1ExecRuncodeTest.test_exceptions.<locals>.<lambda>�s��#�*=�a�*@�*@�rc��dSrrrrrr z1ExecRuncodeTest.test_exceptions.<locals>.<lambda>�s���r)r�runcode�assertIs�
user_exc_inforXr�r	r<�__excepthook__rr
rlr�r��
isinstance�__context__)rrrrr1s     r�test_exceptionszExecRuncodeTest.test_exceptions�s���
�W��
�
�
�5�����
�
�b�&�q�)�+<�=�=�=������l�C�4F�G�G�G�@�@���
�
�
�5�����
�
�d�h�m�A�&�(9�:�:�:�%����
�
�
�5�����#���1�b��
�
�a��#�#�#����
�1�=�2C�D�D�E�E�E�E�ErN)rrr�classmethodrrrrrrrr�s\�������(�(��[�(��4�4��[�4�F�F�F�F�Frr�__main__rL)�	verbosity)r��idlelibrr�r<�test.supportrr�unittestr�idlelib.idle_test.mock_idler�testing�TestCaser	r�r\rqr�r�r�r�rr�mainrrr�<module>r*s=����������	�	�	�	�
�
�
�
�9�9�9�9�9�9�9�9���������������,�,�,�,�,�,����@/�@/�@/�@/�@/�H�%�@/�@/�@/�H0�0�0�0�0��0�0�0�'�'�'�'�'�'�'�'�d1�d1�d1�d1�d1��)�d1�d1�d1�Nl1�l1�l1�l1�l1��*�l1�l1�l1�^&/�&/�&/�&/�&/��*�&/�&/�&/�R�����h�'����8F�F�F�F�F�h�'�F�F�F�@�z����H�M�A��������r