%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/nose/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/nose/__pycache__/result.cpython-37.pyc

B

9�`U�@s�dZddlZyddlmZWn ek
r<ddlmZYnXddlmZddlm	Z	m
Ze�d�Z
dd�ZGd	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.resultcCs"yt|�Sdt|�jSdS)Nz<unprintable %s object>)�str�type�__name__)�exc�r
�</opt/alt/python37/lib/python3.7/site-packages/nose/result.py�_exception_detailsrc@sfeZdZdZddd�Zdd�Zdd�Zd	d
�Zddd�Zd
d�Z	dd�Z
dd�Zdd�Zddd�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.
    NcCs:|dkri}||_|dkr t�}||_t�||||�dS)N)�errorClassesr�configr�__init__)�self�stream�descriptions�	verbosityrrr
r
rr$szTextTestResult.__init__cCsJddlm}||jkrF|j|\}}}|�||f�|�|||df�dS)Nr)�SkipTest)�nose.plugins.skiprr�append�
printLabel)r�test�reasonr�storage�label�isfailr
r
r�addSkip.s

zTextTestResult.addSkipcCs�|\}}}y|�||�}Wntk
r8|�|�}YnXxZt|j���D]H\}\}}	}
t|�rJt||�rJ|
rtd|_|�||f�|�	|	|�dSqJW|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�
issubclassZpassedrr�errors)rr�errZecZev�tb�exc_info�clsrrrr
r
r�addError6s
zTextTestResult.addErrorcCs"|jr|��pt|�St|�SdS)N)rZshortDescriptionr)rrr
r
r�getDescriptionPszTextTestResult.getDescriptioncCslt|dd�}|dk	rh|jrP|g}|r>t|d�}|r>|�|�|�d�|��n|jrh|�|dd��dS)Nr�z: )�getattr�showAllrr�writeln�join�dots�write)rrr&r�messageZdetailr
r
rrVs
zTextTestResult.printLabelcCs`t�|�x6t|j���D]$}|j|\}}}|r|�||�qWt|d�r\|jj�	|j
�dS)z<Overrides to print all errorClasses errors as well.
        rN)r�printErrorsr"r�keysZprintErrorList�hasattrrZpluginsZreportr)rr)rrrr
r
rr4ds

zTextTestResult.printErrorscCs2|jj}|jj}t||�}|j}|dkr.dp0d}||j�|d|||f�|�i}t|j���}	x2|	D]*}
|j|
\}}}
t	|�}|s�ql|||<qlWt	|j
�r�t	|j
�|d<t	|j�r�t	|j�|d<|��s�|d�n|d�t|�
��}|�r(|��|d	�|d
�dd�|D���|d
�n|�dS)zZCalled by the test runner to print the final summary of test
        run results.
        r,�s�zRan %s test%s in %.3fs�failuresr%ZFAILEDZOKz (z, cSsg|]\}}d||f�qS)z%s=%sr
)�.0r�countr
r
r�
<listcomp>�sz/TextTestResult.printSummary.<locals>.<listcomp>�)N)rr2r/�floatZtestsRunZ
separator2r"rr5�lenr9r%�
wasSuccessfulr#�sortr0)r�start�stopr2r/Ztaken�runZpluralZsummaryZeckeysr)rrrr;r#r
r
r�printSummaryps>





zTextTestResult.printSummarycCsJ|js|jrdSx4t|j���D]"}|j|\}}}|s:q |r dSq WdS)z�Overrides to check that there are no errors in errorClasses
        lists that are marked as errors and should cause a run to
        fail.
        FT)r%r9r"rr5)rr)rrrr
r
rr@�szTextTestResult.wasSuccessfulcCsjy|�||�}Wntk
r.|�|�}YnX|j�||f�|jrT|j�d�n|jrf|j�d�dS)Nr�E)r r!r%rr.rr2r1)rrr&r(r
r
r�	_addError�szTextTestResult._addErrorcCsbddlm}t|d�r2t|d|�r2t|d�Syt�|||�Stk
r\t�||�SXdS)Nr)rr,)rrrr$rrr r!)rr&rrr
r
rr �sz"TextTestResult._exc_info_to_string)NN)N)N)r�
__module__�__qualname__�__doc__rrr*r+rr4rEr@rGr r
r
r
rr
s
	
)r
cOs ddlm}|dt�t||�S)Nr)�warnz�ln() has moved to nose.util from nose.result and will be removed from nose.result in a future release. Please update your imports )�warningsrK�DeprecationWarning�_ln)�arg�kwrKr
r
rr�sr)rJZloggingZunittest.runnerr�ImportErrorZunittestZnose.configrZ	nose.utilrrrNZ	getLogger�logrr
r
r
r
r�<module>	s
#

Zerion Mini Shell 1.0