3 \ï(ã@s|dZddlZddlmZddlmZdZdd„ZGd d „d eƒZGd d„deƒZ Gd d „d eƒZ dd„Z Gdd„deƒZ dS)Ú TestSuiteé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@speZdZdZdZffdd„Zdd„Zdd„Zd d „Zd d „Z d d„Z dd„Z dd„Z dd„Z dd„Zdd„ZdS)Ú BaseTestSuitezNA simple test suite that doesn't provide class or module shared fixtures. TcCsg|_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ƒrdSt|ddƒrNdSt|ddƒ}|dk rØt|dƒz^y |ƒWnNtk rÆ}z2t|tƒr–‚tj|ƒ}d|}|j|||ƒWYdd}~XnXWdt|d ƒXdS) NrAr;Fr<rDÚ tearDownClassrFztearDownClass (%s)rG) r rr rHrrCrrrI) rr r.rJrKr[rLrMrNrrrr>ós,         $z TestSuite._tearDownPreviousClassN)F) r6r7r8r9r0r5r@rPr?rIrBr>rrrrr\s ! c@sTeZdZdZdZdd„Zdd„Zdd„Zd d „Zd d „Z d d„Z dd„Z dd„Z dS)rWz¾ Placeholder for a TestCase inside a result. As far as a TestResult is concerned, this looks exactly like a unit test. Used to insert arbitrary errors into a test suite run. NcCs ||_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) r6r7r8r9ZfailureExceptionrr]r^rr_r0r4rrrrrrWsrWc Cs&y t|ƒWntk r dSXdS)z?A crude way to tell apart testcases and suites with duck-typingTF)rr")r rrrr=4s  r=c@seZdZdZdZdZdZdS)rCzCUsed by the TestSuite to hold previous class when running in debug.NF)r6r7r8r9rAr<r+rrrrrC=srC) r9rRÚrrZ __unittestr ÚobjectrrrWr=rCrrrrÚs  L3&