Sindbad~EG File Manager
�
&Μg�= � �� � d Z ddlmZ ddlZddlZddlmZmZ ddlZddlm Z ddlZddl
mZ de_ G d� d ej � Z G d
� de� Z G d� d
� Z G d� dej � Z G d� dej � Z G d� dej � Z G d� dej � Z G d� dej � Zedk( r ej0 d�� yy)zTest run, coverage 54%.� )�runN)�captured_output�captured_stderr)�mock)�FuncTc �~ � e Zd Zd� ZdedfdedfdedffZd� Ze j j ed d
� �� d� � Z
y
)�
ExceptionTestc �J � G d� dt � } |d� } |d� } ||�# |$ r� |�# |$ ry t � 5 }t j j t
d� 5 }d� |_ t j � d d d � n# 1 sw Y nxY wd d d � n# 1 sw Y nxY wY nw xY wY nw xY wj � j � j � }| j dt |� � | j d|d � | j d
|d � y )Nc � � e Zd Zd� Zy)�JExceptionTest.test_print_exception_unhashable.<locals>.UnhashableExceptionc � � y)NT� )�self�others �7/usr/local/lib/python3.12/idlelib/idle_test/test_run.py�__eq__zQExceptionTest.test_print_exception_unhashable.<locals>.UnhashableException.__eq__ s � �� N)�__name__�
__module__�__qualname__r r r r �UnhashableExceptionr s � �
r r �ex1�ex2�cleanup_tracebackc � � | S �Nr ��t�es r �<lambda>z?ExceptionTest.test_print_exception_unhashable.<locals>.<lambda> s � �ar � zUnhashableException: ex2� zUnhashableException: ex1�
)� Exceptionr r �patch�objectr �side_effect�print_exception�getvalue�strip�
splitlines�assertEqual�len�assertIn)r r r r �output�ct�tbs r �test_print_exception_unhashablez-ExceptionTest.test_print_exception_unhashable s� � � �)� � "�%�(��!�%�(�� .��3���"� .�
.�� ��&�
.�$�&�&����*�*�3�0C�D��)7����+�+�-� E�D�D�� '�&�&��
.�� .�� �_�_�
�
$�
$�
&�
1�
1�
3������S��W�%��
�
�0�"�Q�%�8��
�
�0�"�R�&�9sY �$ �B0�,�B*�%B� B �= B�B
�B� B*�B$� B*�'B0�)B*�*B0�/B0�1/0zdivision by zero
�abczSname 'abc' is not defined. Did you mean: 'abs'? Or did you forget to import 'abc'?
zint.reelzAtype object 'int' has no attribute 'reel'. Did you mean: 'real'?
c �j � | j D ]8 \ }}}| j |�� 5 t t |dd� � d d d � �: y # |$ rX t j
� \ }}}t
j |||� d }|j � d|� �}| j ||� Y �gw xY w# 1 sw Y ��xY w)N)�code� �evalr z: )
�data�subTestr8 �compile�sys�exc_infor �get_message_linesr r, ) r r6 �exc�msg�typ�valr1 �actual�expects r �test_get_messagezExceptionTest.test_get_message1 s� � �"�i�i�N�D�#�s����4��(�5����r�6�2�3� )�(� (�� � 5�#&�<�<�>�L�C��b� �2�2�3��R�@��C�F� #���~�R��u�5�F��$�$�V�V�4� 5�� )�(�s) �B)�A � AB&�#B)�%B&�&B)�)B2 r c � � d� S )Nc � � y r r r s r r z(ExceptionTest.<lambda>.<locals>.<lambda>= s � �$r r r r r r zExceptionTest.<lambda>= s � �->r ��new_callablec
�l � | j }|d |d f|d |d f|d |d ff}d}|D ]A \ \ }}}\ }} }
| j ||f�� 5 t t |dd� � d d d � �C | j |t |� � y # |$ r� t t |dd� � nx# | $ rp t � 5 }t j � d d d � n# 1 sw Y nxY wj � }| j ||� | j |
|� |dz
}Y nw xY wY ��w xY w# 1 sw Y ��xY w)Nr � � )�codesr7 r8 )r9 r: r8 r; r r r( r) r. r, r- )
r r �d�data2�subtests�code1�exc1�msg1�code2�exc2�msg2r/ rC s
r �test_get_multiple_messagez'ExceptionTest.test_get_multiple_message<