HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/idlelib/idle_test/__pycache__/test_warning.cpython-310.pyc
o

�i�
�@s�dZddlmZddlmZddlZddlmZddlZej	Z	de	j
vZdZedZ
Gd	d
�d
ej�ZGdd�dej�Ze
d
krHejdd�dSdS)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.cC�D|�tjt�t�d�|�tjtj�t�d�|�tjt�dS�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�Xt��}t�dtdd|d�|�t��|�����Wd�dS1s%wYdS�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)	�
ShellWarnTestrcCrr)r	r
r�shellr�idle_showwarningrrrrr3rzShellWarnTest.test_showwarningscCs"t�dtddd�}|�t|�dSr)r&Zidle_formatwarningrrr)r�srrr�test_idle_formatter;s
�z!ShellWarnTest.test_idle_formatterc	Crr)rr&r'rr�shellmsgrrrrrr�test_shell_showAs�"�zShellWarnTest.test_shell_showN)	rr r!r"r#r$rr)r+rrrrr%1s


r%�__main__�)�	verbosity)�__doc__Zidlelibrrr&r"Ztest.supportrr
rrr$rr*ZTestCaserr%�mainrrrr�<module>s
�