관리-도구
편집 파일: core.cpython-38.pyc
U )�e3 � @ s d Z ddlZddlZddlZddlZddlZddlmZmZ ddl m Z ddlmZm Z mZ ddlmZ ddlmZ ddlmZmZ e�d �Zejd kZddd ddddgZG dd� dej�ZG dd� dej�Ze ZZdd � Zddd�Z dd� Z!e"dk�r e� dS )z,Implements nose test program and collector. � N)�Config�all_config_files)�defaultTestLoader)� PluginManager�DefaultPluginManager�RestrictedPluginManager)�TextTestResult)�FinalizingSuiteWrapper)�isclass�tolistz nose.core)� � �TestProgram�main�run�run_exit� runmodule� collector�TextTestRunnerc @ s4 e Zd ZdZejdddfdd�Zdd� Zdd � ZdS ) r z�Test runner that uses nose's TextTestResult to enable errorClasses, as well as providing hooks for plugins to override or replace the test output stream, results, and the test case itself. � Nc C s* |d krt � }|| _tj�| |||� d S �N)r �config�unittestr �__init__)�self�stream�descriptions� verbosityr � r �7/opt/hc_python/lib/python3.8/site-packages/nose/core.pyr s zTextTestRunner.__init__c C s t | j| j| j| j�S r )r r r r r �r r r r �_makeResult( s �zTextTestRunner._makeResultc C s� | j j�|�}|dk r|}| j j�| j�}|dk r8|| _| �� }t�� }z||� W n tk rh Y nX t�� }|�� |� ||� | j j� |� |S )zaOverrides to provide plugin hooks and defer all output to the test result class. N)r �plugins�prepareTest�setOutputStreamr r! �time�KeyboardInterruptZprintErrorsZprintSummary�finalize)r �test�wrapper�wrapped�result�start�stopr r r r . s"