File: //usr/local/lib/python3.10/idlelib/idle_test/__pycache__/test_run.cpython-310.pyc
o
�iG= � @ s d Z ddlmZ ddlZddlZddlmZmZ ddlZddlm Z ddlZddl
mZ de_G dd � d ej
�ZG d
d� de�ZG dd
� d
�ZG dd� dej
�ZG dd� dej
�ZG dd� dej
�ZG dd� dej
�ZG dd� dej
�Zedkr�ejdd� dS dS )zTest run, coverage 54%.� )�runN)�captured_output�captured_stderr)�mock)�FuncTc @ sV e Zd Zdd� ZdedfdedfdedffZd d
� Ze j
jeddd
� d�dd� �Z
dS )�
ExceptionTestc C s� G dd� dt �}|d�}|d�}z||� |y[ z|� |yX t� �(}tj�td��}dd� |_t�� W d � n1 sBw Y W d � n1 sQw Y Y nw Y nw |�� � � �
� }| �dt|�� | �
d |d
� | �
d|d � d S )
Nc @ � e Zd Zdd� ZdS )zJExceptionTest.test_print_exception_unhashable.<locals>.UnhashableExceptionc S � dS )NT� )�self�otherr
r
�7/usr/local/lib/python3.10/idlelib/idle_test/test_run.py�__eq__ � zQExceptionTest.test_print_exception_unhashable.<locals>.UnhashableException.__eq__N)�__name__�
__module__�__qualname__r r
r
r
r
�UnhashableException s r �ex1�ex2�cleanup_tracebackc S s | S �Nr
��t�er
r
r
�<lambda> � z?ExceptionTest.test_print_exception_unhashable.<locals>.<lambda>� zUnhashableException: ex2� zUnhashableException: ex1�
)� Exceptionr r �patch�objectr Zside_effect�print_exception�getvalue�strip�
splitlines�assertEqual�len�assertIn)r r r r �output�ct�tbr
r
r
�test_print_exception_unhashable s0
������� z-ExceptionTest.test_print_exception_unhashable�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
C s� | j D ]M\}}}| j|d��: z
tt|dd�� W n' |y@ t�� \}}}t�|||�d }|j� d|� �}| � ||� Y nw W d � n1 sKw Y qd S )N)�code� �evalr z: )
�data�subTestr2 �compile�sys�exc_infor Zget_message_linesr r'