AlkantarClanX12

Your IP : 18.222.121.24


Current Path : /opt/alt/python310/lib64/python3.10/unittest/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/unittest/__pycache__/result.cpython-310.opt-2.pyc

o

6��fF!�@sZ	ddlZddlZddlZddlmZddlmZdZdd�ZdZ	d	Z
Gd
d�de�ZdS)�N�)�util��wrapsTcst���fdd��}|S)Ncs*t|dd�r
|���|g|�Ri|��S)N�failfastF)�getattr�stop)�self�args�kw��method��6/opt/alt/python310/lib64/python3.10/unittest/result.py�inner
szfailfast.<locals>.innerr)r
rrrrrsrz
Stdout:
%sz
Stderr:
%sc@s�eZdZ	dZdZdZd/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,�Zd-d.�ZdS)0�
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__&s
zTestResult.__init__cC�dS�Nr�r	rrr�printErrors7�zTestResult.printErrorscCs"	|jd7_d|_|��dS)NrF)rr"�_setupStdout�r	�testrrr�	startTest:szTestResult.startTestcCs<|jr|jdurt��|_t��|_|jt_|jt_dSdSr')rr�io�StringIOrrrr r(rrrr+@s


�zTestResult._setupStdoutcCr&r'rr(rrr�startTestRunHr*zTestResult.startTestRuncCs	|��d|_dS)NF)�_restoreStdoutr"r,rrr�stopTestNs
zTestResult.stopTestcCs�|jrV|jr6tj��}tj��}|r#|�d�s|d7}|j�t	|�|r6|�d�s.|d7}|j
�t|�|jt_|j
t_|j�
d�|j��|j�
d�|j��dSdS)N�
r)rr"rr�getvaluer �endswithr�write�STDOUT_LINEr!�STDERR_LINEr�seek�truncater)r	�output�errorrrrr2Ss&




�zTestResult._restoreStdoutcCr&r'rr(rrr�stopTestRunhr*zTestResult.stopTestRuncC�$	|j�||�||�f�d|_dS�NT)r�append�_exc_info_to_stringr"�r	r-�errrrr�addErrorns
zTestResult.addErrorcCr?r@)rrArBr"rCrrr�
addFailurevs
zTestResult.addFailurecCs`	|dur.t|dd�r|��t|d|j�r|j}n|j}|�||�||�f�d|_dSdS)NrFrT)	rr�
issubclass�failureExceptionrrrArBr")r	r-ZsubtestrDrrrr�
addSubTest}s
�zTestResult.addSubTestcCs	dSr'rr,rrr�
addSuccess�szTestResult.addSuccesscCs	|j�||f�dSr')rrA)r	r-�reasonrrr�addSkip�szTestResult.addSkipcCs	|j�||�||�f�dSr')rrArBrCrrr�addExpectedFailure�s�zTestResult.addExpectedFailurecCs	|j�|�dSr')rrAr,rrr�addUnexpectedSuccess�szTestResult.addUnexpectedSuccesscCs@	t|j�t|j�kodknot|d�pt|j�dkS)Nrr)�lenrr�hasattrrr(rrr�
wasSuccessful�s
$�zTestResult.wasSuccessfulcCs	d|_dSr@)rr(rrrr�s
zTestResult.stopc
Cs�	|\}}}|�||||�}tj||||jdd�}t|���}|jrPtj�	�}tj
�	�}	|r>|�d�s7|d7}|�t
|�|	rP|	�d�sI|	d7}	|�t|	�d�|�S)NT)�capture_locals�compactr4�)�_clean_tracebacks�	traceback�TracebackExceptionr�list�formatrrrr5r r6rAr8r9�join)
r	rDr-�exctype�value�tbZtb_eZmsgLinesr<r=rrrrB�s(
�




zTestResult._exc_info_to_stringc
Cs�d}d}|||fg}t|�h}|rh|��\}}}|r)|�|�r)|j}|r)|�|�s||jur3|�|�|r:|}d}n||_|durf|j|jfD]}	|	duret|	�|vre|�	t
|	�|	|	jf�|�t|	��qG|s|S)NTF)�id�pop�_is_relevant_tb_level�tb_nextrH�_remove_unittest_tb_frames�
__traceback__�	__cause__�__context__rA�type�add)
r	r[r\r]r-Zret�firstZexcs�seen�crrrrU�s.
�

��zTestResult._clean_tracebackscCsd|jjvS)N�
__unittest)�tb_frame�	f_globals)r	r]rrrr`�sz TestResult._is_relevant_tb_levelcCsB	d}|r|�|�s|}|j}|r|�|�r
|durd|_dSdSr')r`ra)r	r]�prevrrrrb�s�
�z%TestResult._remove_unittest_tb_framescCs&dt�|j�|jt|j�t|j�fS)Nz!<%s run=%i errors=%i failures=%i>)rZstrclass�	__class__rrOrrr(rrr�__repr__�s
��zTestResult.__repr__)NNN)�__name__�
__module__�__qualname__Z_previousTestClassZ_testRunEnteredZ_moduleSetUpFailedr%r)r.r+r1r3r2r>rrErFrIrJrLrMrNrQrrBrUr`rbrprrrrrs<




	r)
r/rrVrTr�	functoolsrrkrr8r9�objectrrrrr�<module>s