3 \�(�@sxddlZddlmZddlmZdZdd�ZGdd �d e�ZGd d �d e�ZGd d �d e�Z dd�Z Gdd�de�Z dS)�N�)�case)�utilTcCst||dd��}|�dS)NcSsdS)N�rrr�&/usr/lib64/python3.6/unittest/suite.py� sz!_call_if_exists..)�getattr)�parent�attr�funcrrr�_call_if_exists sr c@sleZdZdZffdd�Zdd�Zdd�Zdd �Zd d �Zd d �Z dd�Z dd�Z dd�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�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�Z dS)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)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 rVc Cs&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�s  L3&