관리-도구
편집 파일: result.cpython-38.pyc
U )�eU � @ s� d Z ddlZzddlmZ W n ek r< ddlmZ Y nX ddlmZ ddlm Z m Z e�d�Z dd� ZG d d � d e�Zdd� Z dS ) z� Test Result ----------- Provides a TextTestResult that extends unittest's _TextTestResult to provide support for error classes (such as the builtin skip and deprecated classes), and hooks for plugins to take over or extend reporting. � N)�_TextTestResult)�Config)�isclass�lnznose.resultc C s* z t | �W S dt| �j Y S X d S )Nz<unprintable %s object>)�str�type�__name__)�exc� r �9/opt/hc_python/lib/python3.8/site-packages/nose/result.py�_exception_detail s r c @ sf e Zd ZdZddd�Zdd� Zdd� Zd d � Zddd�Zd d� Z dd� Z dd� Zdd� Zddd�Z dS )�TextTestResultz�Text test result that extends unittest's default test result support for a configurable set of errorClasses (eg, Skip, Deprecated, TODO) that extend the errors/failures/success triad. Nc C s: |d kri }|| _ |d kr t� }|| _t�| |||� d S �N)�errorClassesr �configr �__init__)�self�stream�descriptions� verbosityr r r r r r $ s zTextTestResult.__init__c C sJ ddl m} || jkrF| j| \}}}|�||f� | �|||d f� d S )Nr ��SkipTest)�nose.plugins.skipr r �append� printLabel)r �test�reasonr �storage�label�isfailr r r �addSkip. s zTextTestResult.addSkipc C s� |\}}}z| � ||�}W n tk r8 | � |�}Y nX t| j�� �D ]J\}\}} } t|�rHt||�rH| rrd|_|�||f� | � | |� dS qH| j �||f� d|_| � d� dS )z�Overrides normal addError to add support for errorClasses. If the exception is a registered class, the error will be added to the list for that class, not errors. FN�ERROR)�_exc_info_to_string� TypeError�listr �itemsr � issubclassZpassedr r �errors)r r �err�ecZev�tb�exc_info�clsr r r r r r �addError6 s zTextTestResult.addErrorc C s"