File: //opt/cppython/lib/python3.8/idlelib/idle_test/__pycache__/test_run.cpython-38.opt-2.pyc
U
0D�g�6 � @ s� d dl mZ d dlZd dlZd dlmZmZ d dlZd dlmZ d dl Z d dl m
Z
de _G dd� dej�Z
G d d
� d
e�ZG dd� d�ZG d
d� dej�ZG dd� dej�ZG dd� dej�ZG dd� dej�ZG dd� dej�Zedkr�ejdd� dS )� )�runN)�captured_output�captured_stderr)�mock)�FuncTc @ s e Zd Zdd� ZdS )�PrintExceptionTestc C s� G dd� dt �}|d�}|d�}z
||�W np |k
r� z|�W nR |k
r� t� �2}tj�td��}dd� |_t�� W 5 Q R X W 5 Q R X Y nX Y nX |�� � � �
� }| �dt|�� | �
d |d
� | �
d|d � d S )
Nc @ s e Zd Zdd� ZdS )zOPrintExceptionTest.test_print_exception_unhashable.<locals>.UnhashableExceptionc S s dS )NT� )�self�otherr r �9/opt/cppython/lib/python3.8/idlelib/idle_test/test_run.py�__eq__ s zVPrintExceptionTest.test_print_exception_unhashable.<locals>.UnhashableException.__eq__N)�__name__�
__module__�__qualname__r r r r r �UnhashableException s r �ex1�ex2Zcleanup_tracebackc S s | S �Nr )�t�er r r �<lambda>! � zDPrintExceptionTest.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 s(
�
(z2PrintExceptionTest.test_print_exception_unhashableN)r
r r r( r r r r r s r c @ s<