File: //usr/local/lib/python3.10/idlelib/idle_test/__pycache__/test_warning.cpython-310.pyc
o
�i�
� @ s� d Z ddlmZ ddlmZ ddlZddlmZ ddlZej Z de j
v ZdZed Z
G d d
� d
ej�ZG dd� dej�Ze
d
krHejdd� dS dS )a6 Test warnings replacement in pyshell.py and run.py.
This file could be expanded to include traceback overrides
(in same two modules). If so, change name.
Revise if output destination changes (http://bugs.python.org/issue18318).
Make sure warnings module is left unaltered (http://bugs.python.org/issue18081).
� )�run)�pyshellN)�captured_stderrZidlezf
Warning (from warnings module):
File "test_warning.py", line 99
Line of code
UserWarning: Test
z>>> c @ s( e Zd Ze�ed�dd� �Zdd� ZdS )�RunWarnTest�#Does not work when run within Idle.c C �D | � tjt� t�d� | � tjtj� t�d� | � tjt� d S �NTF)�assertIs�warnings�showwarningr �capture_warnings�idle_showwarning_subproc��self� r �;/usr/local/lib/python3.10/idlelib/idle_test/test_warning.py�test_showwarnings! �
zRunWarnTest.test_showwarningsc C �X t � �}t�dtdd|d� | �t�� |�� �� � W d � d S 1 s%w Y d S �NZTestztest_warning.py�c zLine of code)r r r
�UserWarning�assertEqual�idlemsg�
splitlines�getvalue�r �fr r r �
test_run_show) s �"�zRunWarnTest.test_run_showN)�__name__�
__module__�__qualname__�unittest�skipIf�running_in_idler r r r r r r s
r c @ s0 e Zd Ze�ed�dd� �Zdd� Zdd� ZdS ) �
ShellWarnTestr c C r r )r r
r �shellr �idle_showwarningr r r r r 3 r zShellWarnTest.test_showwarningsc C s"