Your IP : 3.21.247.221


Current Path : /lib64/python3.8/unittest/__pycache__/
Upload File :
Current File : //lib64/python3.8/unittest/__pycache__/result.cpython-38.opt-2.pyc

U

e5d�@sXddlZddlZddlZddlmZddlmZdZdd�ZdZ	d	Z
Gd
d�de�ZdS)�N�)�util��wrapsTcst���fdd��}|S)Ncs$t|dd�r|���|f|�|�S)N�failfastF)�getattr�stop)�self�args�kw��method��'/usr/lib64/python3.8/unittest/result.py�inner
szfailfast.<locals>.innerr)r
rrrrrsrz
Stdout:
%sz
Stderr:
%sc@s�eZdZdZdZdZd-dd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
edd��Zedd��Zdd�Zdd�Zdd�Zdd�Zedd ��Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�ZdS).�
TestResultNFcCsbd|_g|_g|_d|_g|_g|_g|_d|_d|_d|_	d|_
d|_tj
|_tj|_d|_dS)NFr)r�failures�errors�testsRun�skipped�expectedFailures�unexpectedSuccesses�
shouldStop�buffer�	tb_locals�_stdout_buffer�_stderr_buffer�sys�stdout�_original_stdout�stderr�_original_stderr�
_mirrorOutput)r	�streamZdescriptions�	verbosityrrr�__init__&szTestResult.__init__cCsdS�Nr�r	rrr�printErrors7szTestResult.printErrorscCs |jd7_d|_|��dS)NrF)rr"�_setupStdout�r	�testrrr�	startTest:szTestResult.startTestcCs8|jr4|jdkr$t��|_t��|_|jt_|jt_dSr&)rr�io�StringIOrrrr r'rrrr)@s


zTestResult._setupStdoutcCsdSr&rr'rrr�startTestRunHszTestResult.startTestRuncCs|��d|_dS)NF)�_restoreStdoutr"r*rrr�stopTestNszTestResult.stopTestcCs�|jr�|jrltj��}tj��}|rF|�d�s6|d7}|j�t	|�|rl|�d�s\|d7}|j
�t|�|jt_|j
t_|j�
d�|j��|j�
d�|j��dS)N�
r)rr"rr�getvaluer �endswithr�write�STDOUT_LINEr!�STDERR_LINEr�seek�truncater)r	�output�errorrrrr0Ss$




zTestResult._restoreStdoutcCsdSr&rr'rrr�stopTestRunhszTestResult.stopTestRuncCs"|j�||�||�f�d|_dS�NT)r�append�_exc_info_to_stringr"�r	r+�errrrr�addErrornszTestResult.addErrorcCs"|j�||�||�f�d|_dSr=)rr>r?r"r@rrr�
addFailurevszTestResult.addFailurecCsZ|dk	rVt|dd�r|��t|d|j�r4|j}n|j}|�||�||�f�d|_dS)NrFrT)	rr�
issubclass�failureExceptionrrr>r?r")r	r+ZsubtestrArrrr�
addSubTest}szTestResult.addSubTestcCsdSr&rr*rrr�
addSuccess�szTestResult.addSuccesscCs|j�||f�dSr&)rr>)r	r+�reasonrrr�addSkip�szTestResult.addSkipcCs|j�||�||�f�dSr&)rr>r?r@rrr�addExpectedFailure�s�zTestResult.addExpectedFailurecCs|j�|�dSr&)rr>r*rrr�addUnexpectedSuccess�szTestResult.addUnexpectedSuccesscCs>t|j�t|j�kodkno<t|d�p<t|j�dkS)Nrr)�lenrr�hasattrrr'rrr�
wasSuccessful�s$�zTestResult.wasSuccessfulcCs
d|_dSr=)rr'rrrr�szTestResult.stopcCs�|\}}}|r |�|�r |j}q
||jkr6|�|�}nd}tj|||||jd�}t|���}|j	r�t
j��}	t
j
��}
|	r�|	�d�s�|	d7}	|�t|	�|
r�|
�d�s�|
d7}
|�t|
�d�|�S)N)�limit�capture_localsr2�)�_is_relevant_tb_level�tb_nextrE�_count_relevant_tb_levels�	traceback�TracebackExceptionr�list�formatrrrr3r r4r>r6r7�join)r	rAr+�exctype�value�tb�lengthZtb_eZmsgLinesr:r;rrrr?�s4

�



zTestResult._exc_info_to_stringcCsd|jjkS)N�
__unittest)�tb_frame�	f_globals)r	r\rrrrR�sz TestResult._is_relevant_tb_levelcCs&d}|r"|�|�s"|d7}|j}q|S)Nrr)rRrS)r	r\r]rrrrT�s
z$TestResult._count_relevant_tb_levelscCs&dt�|j�|jt|j�t|j�fS)Nz!<%s run=%i errors=%i failures=%i>)rZstrclass�	__class__rrLrrr'rrr�__repr__�s
��zTestResult.__repr__)NNN)�__name__�
__module__�__qualname__Z_previousTestClassZ_testRunEnteredZ_moduleSetUpFailedr%r(r,r)r/r1r0r<rrBrCrFrGrIrJrKrNrr?rRrTrbrrrrrs6



	r)
r-rrUrQr�	functoolsrr^rr6r7�objectrrrrr�<module>s

?>