관리-도구
편집 파일: test_warning.cpython-37.opt-2.pyc
B YI~d� � @ s� d dl mZ d dl mZ d dlZd dlmZ d dlZejZdej kZ dZed ZG dd � d ej �ZG d d� dej �Ze dkr�ejd d� dS )� )�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 )�RunWarnTestz#Does not work when run within Idle.c C sD | � tjt� t�d� | � tjtj� t�d� | � tjt� d S )NTF)�assertIs�warnings�showwarningr �capture_warnings�idle_showwarning_subproc)�self� r �C/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_warning.py�test_showwarnings! s zRunWarnTest.test_showwarningsc C sB t � �2}t�dtdd|d� | �t�� |�� �� � W d Q R X d S )N�Testztest_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 ) � ShellWarnTestz#Does not work when run within Idle.c C sD | � tjt� t�d� | � tjtj� t�d� | � tjt� d S )NTF)r r r �shellr �idle_showwarning)r r r r r 3 s zShellWarnTest.test_showwarningsc C s"