ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python37/lib64/python3.7/unittest/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python37/lib64/python3.7/unittest/__pycache__/suite.cpython-37.opt-2.pyc

B

0��c�(�@sxddlZddlmZddlmZdZdd�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�Z	dd�Z
Gdd�de�ZdS)�N�)�case)�utilTcCst||dd��}|�dS)NcSsdS)N�rrr�3/opt/alt/python37/lib64/python3.7/unittest/suite.py�<lambda>�z!_call_if_exists.<locals>.<lambda>)�getattr)�parent�attr�funcrrr�_call_if_existssr
c@sjeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�
BaseTestSuiteTrcCsg|_d|_|�|�dS)Nr)�_tests�_removed_tests�addTests)�self�testsrrr�__init__szBaseTestSuite.__init__cCsdt�|j�t|�fS)Nz
<%s tests=%s>)r�strclass�	__class__�list)rrrr�__repr__szBaseTestSuite.__repr__cCs t||j�stSt|�t|�kS)N)�
isinstancer�NotImplementedr)r�otherrrr�__eq__szBaseTestSuite.__eq__cCs
t|j�S)N)�iterr)rrrr�__iter__"szBaseTestSuite.__iter__cCs(|j}x|D]}|r||��7}qW|S)N)r�countTestCases)rZcases�testrrrr%s

zBaseTestSuite.countTestCasescCsLt|�std�t|����t|t�r<t|tjt	f�r<td��|j
�|�dS)Nz{} is not callablezNTestCases and TestSuites must be instantiated before passing them to addTest())�callable�	TypeError�format�reprr�type�
issubclassrZTestCase�	TestSuiter�append)rr rrr�addTest,szBaseTestSuite.addTestcCs.t|t�rtd��x|D]}|�|�qWdS)Nz0tests must be an iterable of tests, not a string)r�strr"r))rrr rrrr6s

zBaseTestSuite.addTestscCs:x4t|�D](\}}|jrP||�|jr
|�|�q
W|S)N)�	enumerate�
shouldStop�_cleanup�_removeTestAtIndex)r�result�indexr rrr�run<szBaseTestSuite.runcCsNy|j|}Wntk
r"Yn(Xt|d�r@|j|��7_d|j|<dS)Nr)rr"�hasattrrr)rr0r rrrr.Es
z BaseTestSuite._removeTestAtIndexcOs|j||�S)N)r1)r�args�kwdsrrr�__call__SszBaseTestSuite.__call__cCsx|D]}|��qWdS)N)�debug)rr rrrr6Vs
zBaseTestSuite.debugN)r)�__name__�
__module__�__qualname__r-rrrrrr)rr1r.r5r6rrrrrs

	rc@sNeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)r'FcCs�d}t|dd�dkrd|_}x�t|�D]�\}}|jr8Pt|�r�|�||�|�||�|�||�|j|_	t|jdd�s(t|dd�r�q(|s�||�n|�
�|jr(|�|�q(W|r�|�d|�|�
|�d|_|S)NF�_testRunEnteredT�_classSetupFailed�_moduleSetUpFailed)r	r:r+r,�_isnotsuite�_tearDownPreviousClass�_handleModuleFixture�_handleClassSetUpr�_previousTestClassr6r-r.�_handleModuleTearDown)rr/r6ZtopLevelr0r rrrr1fs0


z
TestSuite.runcCst�}|�|d�dS)NT)�_DebugResultr1)rr6rrrr6�szTestSuite.debugc	
Cs�t|dd�}|j}||krdS|jr(dSt|dd�r8dSy
d|_Wntk
rVYnXt|dd�}|dk	r�t|d�zdy
|�WnTtk
r�}z6t|t�r��d|_t	�
|�}d|}|�|||�Wdd}~XYnXWdt|d�XdS)	NrA�__unittest_skip__F�
setUpClass�_setupStdoutTzsetUpClass (%s)�_restoreStdout)r	rr<r;r"r
�	ExceptionrrCrr�_addClassOrModuleLevelException)	rr r/�
previousClass�currentClassrE�e�	className�	errorNamerrrr@�s2




$zTestSuite._handleClassSetUpcCs"d}t|dd�}|dk	r|j}|S)NrA)r	r8)rr/�previousModulerJrrr�_get_previous_module�s
zTestSuite._get_previous_modulec	
Cs�|�|�}|jj}||krdS|�|�d|_ytj|}Wntk
rPdSXt|dd�}|dk	r�t	|d�zZy
|�WnJt
k
r�}z,t|t�r��d|_d|}|�
|||�Wdd}~XYnXWdt	|d�XdS)NF�setUpModulerFTzsetUpModule (%s)rG)rPrr8rBr<�sys�modules�KeyErrorr	r
rHrrCrI)	rr r/rOZ
currentModule�modulerQrLrNrrrr?�s,




$zTestSuite._handleModuleFixturecCsLt|�}t|dd�}|dk	r8t|tj�r8||t|��n|�|t���dS)N�addSkip)	�_ErrorHolderr	rrZSkipTestr*ZaddErrorrR�exc_info)rr/Z	exceptionrN�errorrVrrrrI�s
z)TestSuite._addClassOrModuleLevelExceptionc
Cs�|�|�}|dkrdS|jr dSytj|}Wntk
rBdSXt|dd�}|dk	r�t|d�zTy
|�WnDtk
r�}z&t|t	�r��d|}|�
|||�Wdd}~XYnXWdt|d�XdS)N�tearDownModulerFztearDownModule (%s)rG)rPr<rRrSrTr	r
rHrrCrI)rr/rOrUrZrLrNrrrrB�s(



$zTestSuite._handleModuleTearDownc	
Cs�t|dd�}|j}||krdSt|dd�r.dSt|dd�r>dSt|dd�rNdSt|dd�}|dk	r�t|d�z^y
|�WnNtk
r�}z0t|t�r��t�|�}d|}|�|||�Wdd}~XYnXWdt|d	�XdS)
NrAr;Fr<rD�
tearDownClassrFztearDownClass (%s)rG)	r	rr
rHrrCrrrI)	rr r/rJrKr[rLrMrNrrrr>�s,



$z TestSuite._tearDownPreviousClassN)F)r7r8r9r1r6r@rPr?rIrBr>rrrrr'\s

! r'c@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)rWNcCs
||_dS)N)�description)rr\rrrrsz_ErrorHolder.__init__cCs|jS)N)r\)rrrr�idsz_ErrorHolder.idcCsdS)Nr)rrrr�shortDescription sz_ErrorHolder.shortDescriptioncCsd|jfS)Nz<ErrorHolder description=%r>)r\)rrrrr#sz_ErrorHolder.__repr__cCs|��S)N)r])rrrr�__str__&sz_ErrorHolder.__str__cCsdS)Nr)rr/rrrr1)sz_ErrorHolder.runcCs
|�|�S)N)r1)rr/rrrr5.sz_ErrorHolder.__call__cCsdS)Nrr)rrrrr1sz_ErrorHolder.countTestCases)r7r8r9ZfailureExceptionrr]r^rr_r1r5rrrrrrWs
rWcCs&yt|�Wntk
r dSXdS)NTF)rr")r rrrr=4s
r=c@seZdZdZdZdZdS)rCNF)r7r8r9rAr<r,rrrrrC=srC)rR�rrZ
__unittestr
�objectrr'rWr=rCrrrr�<module>sL3&	

Zerion Mini Shell 1.0