Your IP : 3.15.203.195


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

o

6��fs�@sl	ddlZddlZddlZddlmZddlmZdZGdd�de�Z	Gdd	�d	ej
�ZGd
d�de�ZdS)�N�)�result)�registerResultTc@s(eZdZ	dd�Zdd�Zddd�ZdS)	�_WritelnDecoratorcCs
||_dS�N)�stream)�selfr�r	�6/opt/alt/python310/lib64/python3.10/unittest/runner.py�__init__s
z_WritelnDecorator.__init__cCs|dvrt|��t|j|�S)N)r�__getstate__)�AttributeError�getattrr)r�attrr	r	r
�__getattr__sz_WritelnDecorator.__getattr__NcCs|r|�|�|�d�dS�N�
)�write)r�argr	r	r
�writelns
z_WritelnDecorator.writelnr)�__name__�
__module__�__qualname__rrrr	r	r	r
r
s
rcs�eZdZ	dZdZ�fdd�Zdd�Z�fdd�Z�fd	d
�Z�fdd�Z	�fd
d�Z
�fdd�Z�fdd�Z�fdd�Z
dd�Zdd�Z�ZS)�TextTestResultzF======================================================================zF----------------------------------------------------------------------cs8tt|��|||�||_|dk|_|dk|_||_dS)Nr)�superrrr�showAll�dots�descriptions)rrr�	verbosity��	__class__r	r
r%s



zTextTestResult.__init__cCs,|��}|jr|rd�t|�|f�St|�Sr)ZshortDescriptionr�join�str)r�testZdoc_first_liner	r	r
�getDescription,s
zTextTestResult.getDescriptioncsFtt|��|�|jr!|j�|�|��|j�d�|j��dSdS)Nz ... )rr�	startTestrrrr$�flush�rr#rr	r
r%3s�zTextTestResult.startTestc�Ttt|��|�|jr|j�d�|j��dS|jr(|j�d�|j��dSdS)N�ok�.)	rr�
addSuccessrrrr&rrr'rr	r
r+:��zTextTestResult.addSuccessc�Vtt|��||�|jr|j�d�|j��dS|jr)|j�d�|j��dSdS)N�ERROR�E)	rr�addErrorrrrr&rr�rr#�errrr	r
r0C��zTextTestResult.addErrorcr-)N�FAIL�F)	rr�
addFailurerrrr&rrr1rr	r
r6Lr3zTextTestResult.addFailurecs\tt|��||�|jr|j�d�|��|j��dS|jr,|j�	d�|j��dSdS)Nz
skipped {0!r}�s)
rr�addSkiprrr�formatr&rr)rr#�reasonrr	r
r8Us�zTextTestResult.addSkipcr-)Nzexpected failure�x)	rr�addExpectedFailurerrrr&rrr1rr	r
r<^r3z!TextTestResult.addExpectedFailurecr()Nzunexpected success�u)	rr�addUnexpectedSuccessrrrr&rrr'rr	r
r>gr,z#TextTestResult.addUnexpectedSuccesscCs@|js|jr|j��|j��|�d|j�|�d|j�dS)Nr.r4)rrrrr&�printErrorList�errors�failures�rr	r	r
�printErrorsps


zTextTestResult.printErrorscCsb|D],\}}|j�|j�|j�d||�|�f�|j�|j�|j�d|�|j��qdS)Nz%s: %sz%s)rr�
separator1r$�
separator2r&)rZflavourr@r#r2r	r	r
r?ws�zTextTestResult.printErrorList)rrrrDrErr$r%r+r0r6r8r<r>rCr?�
__classcell__r	r	rr
rs						rc@s6eZdZ	eZ		ddd�dd�Zdd	�Zd
d�ZdS)
�TextTestRunnerNTrF)�	tb_localsc	CsT	|durtj}t|�|_||_||_||_||_||_||_	|dur(||_
dSdSr)�sys�stderrrrrr�failfast�bufferrH�warnings�resultclass)	rrrrrKrLrNrMrHr	r	r
r�s

�zTextTestRunner.__init__cCs|�|j|j|j�Sr)rNrrrrBr	r	r
�_makeResult�szTextTestRunner._makeResultcCs`	|��}t|�|j|_|j|_|j|_t���V|jr0t�|j�|jdvr0tjdt	dd�t
��}t|dd�}|durA|�z||�Wt|dd�}|durT|�nt|dd�}|durc|�wwt
��}Wd�n1srwY||}|�
�t|d�r�|j�|j�|j}|j�d||d	kr�d
p�d|f�|j��d}	}
}z
tt|j|j|jf�}Wn	ty�Ynw|\}	}
}g}
|��s�|j�d
�t|j�t|j�}}|r�|
�d|�|r�|
�d|�n|j�d�|r�|
�d|�|	�r	|
�d|	�|
�r|
�d|
�|
�r#|j�dd�|
�f�n|j�d�|j��|S)N)�default�always�modulezPlease use assert\w+ instead.)�category�message�startTestRun�stopTestRunrEzRan %d test%s in %.3fsrr7�rZFAILEDzfailures=%dz	errors=%dZOKz
skipped=%dzexpected failures=%dzunexpected successes=%dz (%s)z, r) rOrrKrLrHrM�catch_warnings�simplefilter�filterwarnings�DeprecationWarning�time�perf_counterrrC�hasattrrrrEZtestsRun�map�lenZexpectedFailures�unexpectedSuccesses�skippedr
Z
wasSuccessfulrrAr@�appendr!r&)rr#rZ	startTimerUrVZstopTimeZ	timeTaken�runZ
expectedFailsrarbZresultsZinfosZfailedZerroredr	r	r
rd�s�

�
���
�
�

��
�
zTextTestRunner.run)NTrFFNN)rrrrrNrrOrdr	r	r	r
rG�s��rG)
rIr\rMrWrZsignalsrZ
__unittest�objectrZ
TestResultrrGr	r	r	r
�<module>sc

?>