Sindbad~EG File Manager
�
&Μg�
� � � d dl mZ d dl mZ d dlZd dlmZ d dlZej Zdej v Z
dZedz Z G d� d ej � Z G d
� dej � Ze dk( r ej d
�� yy)� )�run)�pyshellN)�captured_stderr�idlezf
Warning (from warnings module):
File "test_warning.py", line 99
Line of code
UserWarning: Test
z>>> c �D � e Zd Z ej ed� d� � Zd� Zy)�RunWarnTest�#Does not work when run within Idle.c �D � | j t j t � t j d� | j t j t j
� t j d� | j t j t � y �NTF)�assertIs�warnings�showwarningr �capture_warnings�idle_showwarning_subproc��selfs �;/usr/local/lib/python3.12/idlelib/idle_test/test_warning.py�test_showwarningszRunWarnTest.test_showwarnings! s` � ��
�
�h�*�*�K�8����T�"��
�
�h�*�*�C�,H�,H�I����U�#��
�
�h�*�*�K�8� c � � t � 5 }t j dt dd|d� | j t
j
� |j � j
� � d d d � y # 1 sw Y y xY w�N�Testztest_warning.py�c zLine of code)r r r �UserWarning�assertEqual�idlemsg�
splitlines�getvalue�r �fs r �
test_run_showzRunWarnTest.test_run_show) s] � �
�
�!��(�(��K�):�B��>�
S�
���W�/�/�1�1�:�:�<�3J�3J�3L�M� �
�
�� �AA3�3A<N)�__name__�
__module__�__qualname__�unittest�skipIf�running_in_idler r! � r r r r s) � ��X�_�_�_�&K�L�9� M�9�Nr r c �J � e Zd Z ej ed� d� � Zd� Zd� Zy)�
ShellWarnTestr c �D � | j t j t � t j d� | j t j t j
� t j d� | j t j t � y r )r r
r �shellr �idle_showwarningr s r r zShellWarnTest.test_showwarnings3 s` � ��
�
�h�*�*�K�8�
���t�$��
�
�h�*�*�E�,B�,B�C�
���u�%��
�
�h�*�*�K�8r c �j � t j dt ddd� }| j t |� y r )r- �idle_formatwarningr r r )r �ss r �test_idle_formatterz!ShellWarnTest.test_idle_formatter; s/ � ��$�$���%6��N�
L������!�$r c � � t � 5 }t j dt dd|d� | j t
j
� |j � j
� � d d d � y # 1 sw Y y xY wr )r r- r. r r �shellmsgr r r s r �test_shell_showzShellWarnTest.test_shell_showA s[ � �
�
�!��"�"��K�):�B��>�
S����X�0�0�2�A�J�J�L�4K�4K�4M�N� �
�
�r"