Your IP : 216.73.216.213
�
�0�iG= � � � d dl mZ d dlZd dlZd dlmZmZ d dlZd dlmZ d dl Z d dl m
Z
de _ G d� dej � � Z
G d � d
e� � 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 ej d�� � dS dS )� )�runN)�captured_output�captured_stderr)�mock)�FuncTc � � e Zd Zd� ZdedfdedfdedffZd� Ze j
� ed d
� �� � d� � � Z
d
S )�
ExceptionTestc � � G d� dt � � } |d� � } |d� � } ||�# |$ r� |�# |$ r� t � � 5 }t j � t
d� � 5 }d� |_ t j � � d d d � � n# 1 swxY w Y d d d � � n# 1 swxY w Y Y nw xY wY nw xY w|� � � � � � �
� � }| � dt |� � � � | �
d|d � � | �
d
|d � � d S )Nc � � e Zd Zd� ZdS )�JExceptionTest.test_print_exception_unhashable.<locals>.UnhashableExceptionc � � dS )NT� )�self�others �A/opt/alt/python311/lib64/python3.11/idlelib/idle_test/test_run.py�__eq__zQExceptionTest.test_print_exception_unhashable.<locals>.UnhashableException.__eq__ s � ��t� 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 � �a� r � 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�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 �~ � | j D ]�\ }}}| � |�� � 5 t t |dd� � � � n`# |$ rX t j � � \ }}}t
j |||� � d }|j � d|� �}| � ||� � Y nw xY wd d d � � n# 1 swxY w Y ��d S )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_message0 s% � �"�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 r c � � d� S )Nc � � d S r r r s r r z(ExceptionTest.<lambda>.<locals>.<lambda><