File: //proc/self/root/opt/alt/python37/lib/python3.7/site-packages/nose/__pycache__/core.cpython-37.pyc
B
9�`3 � @ 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 �:/opt/alt/python37/lib/python3.7/site-packages/nose/core.pyr s zTextTestRunner.__init__c C s t | j| j| j| j�S )N)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�� }y||� 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"