HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/idlelib/idle_test/__pycache__/test_warning.cpython-38.pyc
U

�i�_�
�@s�dZddlmZddlmZddlZddlmZddlZej	Z	de	j
kZdZedZ
Gd	d
�d
ej�ZGdd�dej�Ze
d
kr�ejdd�dS)a6Test 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(eZdZe�ed�dd��Zdd�ZdS)�RunWarnTest�#Does not work when run within Idle.cCsD|�tjt�t�d�|�tjtj�t�d�|�tjt�dS�NTF)�assertIs�warnings�showwarningr�capture_warnings�idle_showwarning_subproc��self�r�=/opt/python38/lib/python3.8/idlelib/idle_test/test_warning.py�test_showwarnings!s


zRunWarnTest.test_showwarningsc	CsBt��2}t�dtdd|d�|�t��|�����W5QRXdS�NZTestztest_warning.py�czLine of code)rrr�UserWarning�assertEqual�idlemsg�
splitlines�getvalue�r�frrr�
test_run_show)s�zRunWarnTest.test_run_showN)�__name__�
__module__�__qualname__�unittest�skipIf�running_in_idlerrrrrrrs

rc@s0eZdZe�ed�dd��Zdd�Zdd�ZdS)	�
ShellWarnTestrcCsD|�tjt�t�d�|�tjtj�t�d�|�tjt�dSr)rr	r
�shellr�idle_showwarningr
rrrr3s


zShellWarnTest.test_showwarningscCs"t�dtddd�}|�t|�dSr)r#Zidle_formatwarningrrr)r�srrr�test_idle_formatter;s�z!ShellWarnTest.test_idle_formatterc	CsBt��2}t�dtdd|d�|�t��|�����W5QRXdSr)rr#r$rr�shellmsgrrrrrr�test_shell_showAs�zShellWarnTest.test_shell_showN)	rrrrr r!rr&r(rrrrr"1s

r"�__main__�)�	verbosity)�__doc__Zidlelibrrr#rZtest.supportrr	r
rr!rr'ZTestCaserr"�mainrrrr�<module>s