a  ze @sddlmZddlmZddlZddlmZddlZejZdej vZ dZ e dZ Gdd d ej ZGd d d ej Ze d krejd ddS))run)pyshellN)captured_stderrZidlezf Warning (from warnings module): File "test_warning.py", line 99 Line of code UserWarning: Test z>>> c@s(eZdZeedddZddZdS) RunWarnTest#Does not work when run within Idle.cCsD|tjttd|tjtjtd|tjtdSNTF)assertIswarnings showwarningrcapture_warningsidle_showwarning_subprocselfrR/opt/bitninja-python-dojo/embedded/lib/python3.9/idlelib/idle_test/test_warning.pytest_showwarnings!s   zRunWarnTest.test_showwarningsc CsVt<}tdtdd|d|t|Wdn1sH0YdSNZTestztest_warning.pycz Line of code)rrr UserWarning assertEqualidlemsg splitlinesgetvaluerfrrr test_run_show)s  zRunWarnTest.test_run_showN)__name__ __module__ __qualname__unittestskipIfrunning_in_idlerrrrrrrs  rc@s0eZdZeedddZddZddZdS) ShellWarnTestrcCsD|tjttd|tjtjtd|tjtdSr)rr r shellr idle_showwarningr rrrr3s   zShellWarnTest.test_showwarningscCs"tdtddd}|t|dSr)r#Zidle_formatwarningrrr)rsrrrtest_idle_formatter;s z!ShellWarnTest.test_idle_formatterc CsVt<}tdtdd|d|t|Wdn1sH0YdSr)rr#r$rrshellmsgrrrrrrtest_shell_showAs  zShellWarnTest.test_shell_showN) rrrrr r!rr&r(rrrrr"1s  r"__main__) verbosity)Zidlelibrrr#rZ test.supportrr r rr!rr'ZTestCaserr"mainrrrrs