AlkantarClanX12

Your IP : 3.145.95.233


Current Path : /usr/lib64/python3.6/unittest/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/unittest/__pycache__/suite.cpython-36.opt-2.pyc

3


 \�(�@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�&/usr/lib64/python3.6/unittest/suite.py�<lambda>sz!_call_if_exists.<locals>.<lambda>)�getattr)�parent�attr�funcrrr�_call_if_existssrc@sleZdZdZffdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�
BaseTestSuiteTcCsg|_d|_|j|�dS)Nr)�_tests�_removed_tests�addTests)�self�testsrrr�__init__szBaseTestSuite.__init__cCsdtj|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||j�7}qW|S)N)r�countTestCases)rZcases�testrrrr%s

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

zBaseTestSuite.addTestscCs:x4t|�D](\}}|jrP||�|jr
|j|�q
W|S)N)�	enumerate�
shouldStop�_cleanup�_removeTestAtIndex)r�result�indexrrrr�run<szBaseTestSuite.runcCsNy|j|}Wntk
r"Yn(Xt|d�r@|j|j�7_d|j|<dS)Nr)rr!�hasattrrr)rr/rrrrr-Es
z BaseTestSuite._removeTestAtIndexcOs|j||�S)N)r0)r�args�kwdsrrr�__call__SszBaseTestSuite.__call__cCsx|D]}|j�qWdS)N)�debug)rrrrrr5Vs
zBaseTestSuite.debugN)�__name__�
__module__�__qualname__r,rrrrrr(rr0r-r4r5rrrrr
s
	r
c@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||�|j||�|j||�|j|_	t|jdd�s(t|dd�r�q(|s�||�n|j
�|jr(|j|�q(W|r�|jd|�|j
|�d|_|S)NF�_testRunEnteredT�_classSetupFailed�_moduleSetUpFailed)rr9r*r+�_isnotsuite�_tearDownPreviousClass�_handleModuleFixture�_handleClassSetUpr�_previousTestClassr5r,r-�_handleModuleTearDown)rr.r5ZtopLevelr/rrrrr0fs0


z
TestSuite.runcCst�}|j|d�dS)NT)�_DebugResultr0)rr5rrrr5�szTestSuite.debugc	 Cs�t|dd�}|j}||krdS|jr(dSt|dd�r8dSy
d|_Wntk
rVYnXt|dd�}|dk	r�t|d�zdy
|�WnTtk
r�}z8t|t�r��d|_t	j
|�}d|}|j|||�WYdd}~XnXWdt|d�XdS)	Nr@�__unittest_skip__F�
setUpClass�_setupStdoutTzsetUpClass (%s)�_restoreStdout)rrr;r:r!r�	ExceptionrrBrr�_addClassOrModuleLevelException)	rrr.�
previousClass�currentClassrD�e�	className�	errorNamerrrr?�s2




$zTestSuite._handleClassSetUpcCs"d}t|dd�}|dk	r|j}|S)Nr@)rr7)rr.�previousModulerIrrr�_get_previous_module�s
zTestSuite._get_previous_modulec	 Cs�|j|�}|jj}||krdS|j|�d|_ytj|}Wntk
rPdSXt|dd�}|dk	r�t	|d�zZy
|�WnJt
k
r�}z.t|t�r��d|_d|}|j
|||�WYdd}~XnXWdt	|d�XdS)NF�setUpModulerETzsetUpModule (%s)rF)rOrr7rAr;�sys�modules�KeyErrorrrrGrrBrH)	rrr.rNZ
currentModule�modulerPrKrMrrrr>�s,




$zTestSuite._handleModuleFixturecCsLt|�}t|dd�}|dk	r8t|tj�r8||t|��n|j|tj��dS)N�addSkip)	�_ErrorHolderrrrZSkipTestr)ZaddErrorrQ�exc_info)rr.Z	exceptionrM�errorrUrrrrH�s
z)TestSuite._addClassOrModuleLevelExceptionc Cs�|j|�}|dkrdS|jr dSytj|}Wntk
rBdSXt|dd�}|dk	r�t|d�zTy
|�WnDtk
r�}z(t|t	�r��d|}|j
|||�WYdd}~XnXWdt|d�XdS)N�tearDownModulerEztearDownModule (%s)rF)rOr;rQrRrSrrrGrrBrH)rr.rNrTrYrKrMrrrrA�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�}z2t|t�r��tj|�}d|}|j|||�WYdd}~XnXWdt|d	�XdS)
Nr@r:Fr;rC�
tearDownClassrEztearDownClass (%s)rF)	rrrrGrrBrrrH)	rrr.rIrJrZrKrLrMrrrr=�s,



$z TestSuite._tearDownPreviousClassN)F)r6r7r8r0r5r?rOr>rHrAr=rrrrr&\s

! r&c@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)rVNcCs
||_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|j�S)N)r\)rrrr�__str__&sz_ErrorHolder.__str__cCsdS)Nr)rr.rrrr0)sz_ErrorHolder.runcCs
|j|�S)N)r0)rr.rrrr4.sz_ErrorHolder.__call__cCsdS)Nrr)rrrrr1sz_ErrorHolder.countTestCases)r6r7r8ZfailureExceptionrr\r]rr^r0r4rrrrrrVs
rVcCs&yt|�Wntk
r dSXdS)NTF)rr!)rrrrr<4s
r<c@seZdZdZdZdZdS)rBNF)r6r7r8r@r;r+rrrrrB=srB)rQ�rrZ
__unittestr�objectr
r&rVr<rBrrrr�<module>sL3&