B °-_ï(ã@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/lib/python3.7/unittest/suite.pyÚ óz!_call_if_exists..)Úgetattr)ÚparentÚattrÚfuncrrrÚ_call_if_exists src@sneZdZdZdZddd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„ZdS)Ú BaseTestSuitezNA simple test suite that doesn't provide class or module shared fixtures. TrcCsg|_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ƒrdSt|ddƒrNdSt|ddƒ}|dk rØt|dƒz^y |ƒWnNtk rÆ}z0t|tƒr–‚t |¡}d|}| |||¡Wdd}~XYnXWdt|d ƒXdS) NrBr<Fr=rEÚ tearDownClassrGztearDownClass (%s)rH) r rrrIrrDrrrJ) rr!r/rKrLr\rMrNrOrrrr?ós,         $z TestSuite._tearDownPreviousClassN)F) r7r8r9r:r1r6rArQr@rJrCr?rrrrr\s ! c@sTeZdZdZdZdd„Zdd„Zdd„Zd d „Zd d „Z d d„Z dd„Z dd„Z dS)rXz¾ 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| ¡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)rrrrr 1sz_ErrorHolder.countTestCases) r7r8r9r:ZfailureExceptionrr^r_rr`r1r5r rrrrrXsrXcCs&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)rDzCUsed by the TestSuite to hold previous class when running in debug.NF)r7r8r9r:rBr=r,rrrrrD=srD) r:rSÚrrZ __unittestrÚobjectrrrXr>rDrrrrÚs  L3&