a
    ze                     @   sn   d dl mZ d dlZd dlmZ d dlmZ d dlmZm	Z	 d dl
Z
G dd dejZedkrjejd	d
 dS )    )stackviewerN)requires)Tk)TreeNodeScrolledCanvasc                   @   s,   e Zd Zedd Zedd Zdd ZdS )StackBrowserTestc                 C   sT   t j}zt W n& ty4   t \|_|_|_Y n0 td t	 | _
| j
  d S )NZgui)r   sysabc	NameErrorexc_info	last_type
last_valuelast_tracebackr   r   rootZwithdrawclsZsvs r   8/usr/lib/python3.9/idlelib/idle_test/test_stackviewer.py
setUpClass   s    zStackBrowserTest.setUpClassc                 C   s.   t j}|`|`|`| j  | j  | `d S N)r   r   r   r   r   r   Zupdate_idletasksZdestroyr   r   r   r   tearDownClass   s
    

zStackBrowserTest.tearDownClassc                 C   s<   t | j}| j}|t jt |t jt j |t jt	 d S r   )
r   ZStackBrowserr   ZassertIsInstanceZscr   itemZStackTreeItemZnoder   )selfZsbZisir   r   r   	test_init&   s
    zStackBrowserTest.test_initN)__name__
__module____qualname__classmethodr   r   r   r   r   r   r   r      s
   


r   __main__   )	verbosity)Zidlelibr   ZunittestZtest.supportr   tkinterr   Zidlelib.treer   r   r   ZTestCaser   r   mainr   r   r   r   <module>   s   "