3 /f@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZmZmZmZdZeZdZGdddeZGd d d eZGd d d eZGd ddeZddZddZddZddZddZ ddZ!GdddZ"ddZ#Gdd d e"Z$Gd!d"d"e$Z%Gd#d$d$e$Z&ej'd%d&d'gZ(Gd(d)d)ej)Z*Gd*d+d+e"Z+Gd,d-d-eZ,Gd.d/d/e,Z-Gd0d1d1e,Z.dS)2N)result)strclass safe_repr_count_diff_all_purpose_count_diff_hashable_common_shorten_reprTz@ Diff is %s characters long. Set self.maxDiff to None to see it.c@s eZdZdS)SkipTestN)__name__ __module__ __qualname__r r %/usr/lib64/python3.6/unittest/case.pyr sr c@s eZdZdS) _ShouldStopN)r r r r r r rr"src@s eZdZdS)_UnexpectedSuccessN)r r r r r r rr'src@s&eZdZdddZejdddZdS) _OutcomeNcCs4d|_||_t|d|_d|_g|_d|_g|_dS)NF addSubTestT)expecting_failurerhasattrresult_supports_subtestssuccessskippedexpectedFailureerrors)selfrr r r__init__.s z_Outcome.__init__Fccs|j}d|_zy dVWntk r.Yntk rh}z d|_|jj|t|fWYdd}~Xnjtk rzYnXtj}|j r||_ nd|_|j j||fd}YnX|j r|jr|j j|dfWd|jo||_XdS)NTF) rKeyboardInterruptr rappendstrrsysexc_inforrrr)r test_caseisTestZ old_successer r r rtestPartExecutor7s* $  z_Outcome.testPartExecutor)N)F)r r r r contextlibcontextmanagerr$r r r rr-s rcCs|S)Nr )objr r r_idUsr(csfdd}|S)Ncs4t|ts$tj|fdd}|}d|_|_|S)Ncs tdS)N)r )argskwargs)reasonr r skip_wrapper^sz-skip..decorator..skip_wrapperT) isinstancetype functoolswraps__unittest_skip____unittest_skip_why__) test_itemr,)r+r r decorator\s  zskip..decoratorr )r+r4r )r+rskipXs r5cCs|r t|StS)N)r5r() conditionr+r r rskipIfhsr7cCs|s t|StS)N)r5r()r6r+r r r skipUnlesspsr8cCs d|_|S)NT)__unittest_expecting_failure__)r3r r rrxsrcs4t|tr tfdd|DSt|to2t|S)Nc3s|]}t|VqdS)N) _is_subtype).0r#)basetyper r ~sz_is_subtype..)r-tupleallr. issubclass)expectedr<r )r<rr:|s r:c@seZdZddZddZdS)_BaseTestCaseContextcCs ||_dS)N)r!)rr!r r rrsz_BaseTestCaseContext.__init__cCs |jj|j|}|jj|dS)N)r!_formatMessagemsgfailureException)r standardMsgrDr r r _raiseFailuresz"_BaseTestCaseContext._raiseFailureN)r r r rrGr r r rrBsrBcCsdtjkrt|StSdS)NZWITHIN_PYTHON_RPM_BUILD)osenvironr5r()r+r r r_skipInRpmBuilds rJc@seZdZdddZddZdS)_AssertRaisesBaseContextNcCs@tj||||_||_|dk r*tj|}||_d|_d|_dS)N) rBrrAr!recompileexpected_regexobj_namerD)rrAr!rNr r rrs  z!_AssertRaisesBaseContext.__init__cCszt|j|js"td||jf|rD|ddkrDtjdtdf}|sx|jdd|_ |rttjdt t |td|S|^}}y |j |_ Wntk rt||_ YnX||||WdQRXWdd}XdS)Nz%s() arg 1 must be %srzcallable is NonerDz3%r is an invalid keyword argument for this function)r:rA _base_type TypeError_base_type_strwarningswarnDeprecationWarningpoprDnextiterr rOAttributeErrorr)rnamer)r*Z callable_objr r rhandles.  z_AssertRaisesBaseContext.handle)N)r r r rr\r r r rrKs rKc@s$eZdZeZdZddZddZdS)_AssertRaisesContextz-an exception type or tuple of exception typescCs|S)Nr )rr r r __enter__sz_AssertRaisesContext.__enter__c Cs|dkrby |jj}Wntk r2t|j}YnX|jrP|jdj||jql|jdj|n tj|t ||js|dS|j d|_ |j dkrdS|j }|j t|s|jdj|jt|dS)Nz{} not raised by {}z {} not raisedFTz"{}" does not match "{}")rAr rZrrOrGformat traceback clear_framesr@with_tracebackZ exceptionrNsearchpattern)rexc_type exc_valuetbexc_namerNr r r__exit__s(       z_AssertRaisesContext.__exit__N)r r r BaseExceptionrQrSr^rir r r rr]sr]c@s$eZdZeZdZddZddZdS)_AssertWarnsContextz(a warning type or tuple of warning typescCsRx$tjjD]}t|ddr i|_q Wtjdd|_|jj|_tj d|j |S)N__warningregistry__T)recordalways) rmodulesvaluesgetattrrlrTcatch_warningswarnings_managerr^ simplefilterrA)rvr r rr^s   z_AssertWarnsContext.__enter__c Cs|jj||||dk rdSy |jj}Wntk rFt|j}YnXd}xd|jD]Z}|j}t||jslqT|dkrx|}|j dk r|j j t| rqT||_ |j |_ |j |_ dSW|dk r|jdj|j jt||jr|jdj||jn|jdj|dS)Nz"{}" does not match "{}"z{} not triggered by {}z{} not triggered)rsrirAr rZrrTmessager-rNrcZwarningfilenamelinenorGr_rdrO)rrerfrgrhZfirst_matchingmwr r rris8      z_AssertWarnsContext.__exit__N)r r r WarningrQrSr^rir r r rrks rk_LoggingWatcherrecordsoutputc@s$eZdZddZddZddZdS)_CapturingHandlercCstjj|tgg|_dS)N)loggingHandlerrr|watcher)rr r rr,s z_CapturingHandler.__init__cCsdS)Nr )rr r rflush0sz_CapturingHandler.flushcCs*|jjj||j|}|jjj|dS)N)rr}rr_r~)rrmrDr r remit3s z_CapturingHandler.emitN)r r r rrrr r r rr'src@s(eZdZdZddZddZddZdS) _AssertLogsContextz"%(levelname)s:%(name)s:%(message)scCs:tj||||_|r(tjj|||_ntj|_d|_dS)N) rBr logger_namerZ _nameToLevelgetlevelINFOrD)rr!rrr r rr?s  z_AssertLogsContext.__init__cCst|jtjr|j}|_ntj|j}|_tj|j}t}|j ||j |_ |j dd|_ |j |_|j|_|g|_ |j|j d|_|j S)NF)r-rrZLoggerloggerZ getLoggerZ FormatterLOGGING_FORMATrZ setFormatterrhandlers old_handlersr old_level propagate old_propagatesetLevel)rrZ formatterZhandlerr r rr^Hs   z_AssertLogsContext.__enter__cCs`|j|j_|j|j_|jj|j|dk r.dSt|jj dkr\|j dj t j |j|jjdS)NFrz-no logs of level {} or higher triggered on {})rrrrrrrlenrr}rGr_rZ getLevelNamerr[)rrerfrgr r rriYs  z_AssertLogsContext.__exit__N)r r r rrr^rir r r rr:s rc@seZdZeZdZdZdZdZddd Z d d Z d d Z ddZ ddZ eddZeddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zejefd(d)Zd*d+Zd,d-Zd.d/Z dd1d2Z!d3d4Z"d5d6Z#d7d8Z$d9d:Z%dd;d<Z&dd=d>Z'dd?d@Z(dAdBZ)dCdDZ*dEdFZ+ddGdHZ,dIdJZ-ddKdLZ.ddMdNZ/ddOdPZ0ddQdRZ1ddSdTZ2ddUdVZ3dWdXZ4ddYdZZ5dd[d\Z6dd]d^Z7dd_d`Z8ddadbZ9ddcddZ:ddedfZ;ddgdhZddmdnZ?ddodpZ@ddqdrZAddsdtZBddudvZCddwdxZDddydzZEdd{d|ZFdd}d~ZGddZHddZIdddZJdddZKddZLeLe/ZMZNeLe0ZOZPeLe1ZQZReLe2ZSZTeLe(ZUZVeLe*ZWeLe'ZXeLeHZYeLeJZZeLeKZ[d0S)TestCaseTPFrunTestc Cs||_d|_d|_yt||}Wn.tk rN|dkrJtd|j|fYn X|j|_g|_d|_ i|_ |j t d|j t d|j td|j td|j td|j tddS) NzNo testrzno such test method in %s: %sassertDictEqualassertListEqualassertTupleEqualassertSetEqualassertMultiLineEqual)_testMethodName_outcome_testMethodDocrqrZ ValueError __class____doc__ _cleanups_subtest_type_equality_funcsaddTypeEqualityFuncdictlistr>set frozensetr)rZ methodName testMethodr r rrs&     zTestCase.__init__cCs||j|<dS)N)r)rZtypeobjfunctionr r rrs zTestCase.addTypeEqualityFunccOs|jj|||fdS)N)rr)rrr)r*r r r addCleanupszTestCase.addCleanupcCsdS)Nr )rr r rsetUpszTestCase.setUpcCsdS)Nr )rr r rtearDownszTestCase.tearDowncCsdS)Nr )clsr r r setUpClassszTestCase.setUpClasscCsdS)Nr )rr r r tearDownClassszTestCase.tearDownClasscCsdS)Nrr )rr r rcountTestCasesszTestCase.countTestCasescCstjS)N)rZ TestResult)rr r rdefaultTestResultszTestCase.defaultTestResultcCs |j}|r|jddjpdS)N r)rsplitstrip)rdocr r rshortDescriptionszTestCase.shortDescriptioncCsdt|j|jfS)Nz%s.%s)rrr)rr r ridsz TestCase.idcCs t|t|k rtS|j|jkS)N)r.NotImplementedr)rotherr r r__eq__szTestCase.__eq__cCstt||jfS)N)hashr.r)rr r r__hash__szTestCase.__hash__cCsd|jt|jfS)Nz%s (%s))rrr)rr r r__str__szTestCase.__str__cCsdt|j|jfS)Nz<%s testMethod=%s>)rrr)rr r r__repr__szTestCase.__repr__cCs<t|dd}|dk r |||ntjdtd|j|dS)NaddSkipz4TestResult has no addSkip method, skips not reportedr)rqrTrURuntimeWarning addSuccess)rrr!r+rr r r_addSkips   zTestCase._addSkipcks|jdks|jj rdVdS|j}|dkr8tj|}n |jj|}t||||_zX|jj|jdd dVWdQRX|jj s|jj }|dk r|j rt n |jj rt Wd||_XdS)NT)r")rrr collectionsChainMapparams new_child_SubTestr$rrZfailfastrr)rrDrparentZ params_maprr r rsubTest s$  zTestCase.subTestcCsdx^|D]V\}}t|tr*|j|j||q|dk rt|d|jrP|j||q|j||qWdS)Nr)r-rrr!r@rE addFailureZaddError)rrrtestr r r r_feedErrorsToResult(s zTestCase._feedErrorsToResultc CsDy |j}Wn*tk r4tjdt|j|Yn X|||dS)Nz@TestResult has no addExpectedFailure method, reporting as passes)addExpectedFailurerZrTrUrr)rrr rr r r_addExpectedFailure2s zTestCase._addExpectedFailurecCshy |j}WnPtk rZtjdty tdWn$tk rT|j|tjYnXYn X||dS)NzCTestResult has no addUnexpectedSuccess method, reporting as failure) addUnexpectedSuccessrZrTrUrrrrr )rrrr r r_addUnexpectedSuccess<s  zTestCase._addUnexpectedSuccessNc (Cs|}|dkr.|j}t|dd}|dk r.||j|t||j}t|jdds^t|ddrz,t|jddpxt|dd}|j|||Wd|j|XdSt|dd}t|dd}|p|}t|} z| |_| j ||j WdQRX| j r<|| _ | j |dd |WdQRXd| _ | j ||j WdQRX|jx"| jD]\} } |j|| | qLW|j|| j| j r|r| jr|j|| jn |j|n |j||S|j||dkrt|d d} | dk r| | jjd| _d|_XdS) N startTestRunr1Fr2r9T)r" stopTestRun)rrqZ startTestrrrZstopTestrrr$rrrr doCleanupsrrrrrrrclear) rrZ orig_resultrrZskip_whyZexpecting_failure_methodZexpecting_failure_classroutcomerr+rr r rrunKsh               z TestCase.runc CsN|jp t}x:|jrF|jj\}}}|j||||WdQRXqW|jS)N)rrrrWr$r)rrrr)r*r r rrs   zTestCase.doCleanupscOs |j||S)N)r)rr)kwdsr r r__call__szTestCase.__call__cCsJ|jt||j|jx&|jrD|jjd\}}}|||q WdS)Nr)rrqrrrrW)rrr)r*r r rdebugs zTestCase.debugcCs t|dS)N)r )rr+r r rskipTestszTestCase.skipTestcCs|j|dS)N)rE)rrDr r rfailsz TestCase.failcCs&|r"|j|dt|}|j|dS)Nz%s is not false)rCrrE)rexprrDr r r assertFalseszTestCase.assertFalsecCs&|s"|j|dt|}|j|dS)Nz%s is not true)rCrrE)rrrDr r r assertTrueszTestCase.assertTruec CsP|js|p |S|dkr|Sy d||fStk rJdt|t|fSXdS)Nz%s : %s) longMessageUnicodeDecodeErrorr)rrDrFr r rrCs  zTestCase._formatMessagec Os$t||}z|jd||Sd}XdS)N assertRaises)r]r\)rexpected_exceptionr)r*contextr r rrs zTestCase.assertRaisescOst||}|jd||S)N assertWarns)rkr\)rexpected_warningr)r*rr r rrs zTestCase.assertWarnscCs t|||S)N)r)rrrr r r assertLogsszTestCase.assertLogscCsFt|t|kr@|jjt|}|dk r@t|trt|||kr>dSdt|t|t|f}nF|dkrfd}||k rtt|||dkrdSdt|t||f}|j||}|j|dS)Nz specify delta or places not bothz%s == %s within %s deltarrz%s == %s within %r places)rRrrrrCrE)rrrrrDrrFr r rassertNotAlmostEquals"   zTestCase.assertNotAlmostEqualc'Cs|dk rP|j}t||s.|jd|t|ft||sT|jd|t|fnd}d}y t|}Wn ttfk rd|}YnX|dkry t|}Wn ttfk rd|}YnX|dkr||krdSd|jft||}xt t ||D]} y || } Wn.tt tfk r8|d| |f7}PYnXy || } Wn.tt tfk rt|d| |f7}PYnX| | kr|d | ft| | 7}PqW||kr|dkrt |t |krdS||kr0|d |||f7}y|d |t||f7}Wn,tt tfk r,|d ||f7}YnXnh||kr|d |||f7}y|d |t||f7}Wn,tt tfk r|d||f7}YnX|} ddj tjtj|jtj|j} |j| | } |j|| }|j|dS)NzFirst sequence is not a %s: %szSecond sequence is not a %s: %sZsequencez(First %s has no length. Non-sequence?z)Second %s has no length. Non-sequence?z%ss differ: %s != %s z( Unable to index element %d of first %s z) Unable to index element %d of second %s z# First differing element %d: %s %s z+ First %s contains %d additional elements. zFirst extra element %d: %s z'Unable to index element %d of first %s z, Second %s contains %d additional elements. z(Unable to index element %d of second %s r)r r-rErrrRNotImplementedError capitalizerrangemin IndexErrorr.joindifflibndiffpprintpformat splitlines_truncateMessagerCr)rZseq1Zseq2rDseq_typeZ seq_type_nameZ differingZlen1Zlen2iZitem1Zitem2rFdiffMsgr r rassertSequenceEquals               zTestCase.assertSequenceEqualcCs2|j}|dkst||kr"||S|tt|S)N)maxDiffr DIFF_OMITTED)rrvdiffZmax_diffr r rrszTestCase._truncateMessagecCs|j|||tddS)N)r)r r)rZlist1Zlist2rDr r rr s zTestCase.assertListEqualcCs|j|||tddS)N)r)r r>)rZtuple1Ztuple2rDr r rrs zTestCase.assertTupleEqualc Cshy|j|}Wn^tk r>}z|jd|WYdd}~Xn0tk rl}z|jd|WYdd}~XnXy|j|}Wn^tk r}z|jd|WYdd}~Xn0tk r}z|jd|WYdd}~XnX|p|sdSg}|r|jdx|D]}|jt|qW|rH|jdx|D]}|jt|q0Wdj|} |j|j|| dS)Nz/invalid type when attempting set difference: %sz2first argument does not support set difference: %sz3second argument does not support set difference: %sz*Items in the first set but not the second:z*Items in the second set but not the first:r) differencerRrrZrreprrrC) rZset1Zset2rDZ difference1r#Z difference2linesitemrFr r rr"s2        zTestCase.assertSetEqualcCs2||kr.dt|t|f}|j|j||dS)Nz%s not found in %s)rrrC)rmember containerrDrFr r rassertInMs zTestCase.assertIncCs2||kr.dt|t|f}|j|j||dS)Nz%s unexpectedly found in %s)rrrC)rrrrDrFr r r assertNotInTs zTestCase.assertNotIncCs2||k r.dt|t|f}|j|j||dS)Nz %s is not %s)rrrC)rexpr1expr2rDrFr r rassertIs[s zTestCase.assertIscCs,||kr(dt|f}|j|j||dS)Nzunexpectedly identical: %s)rrrC)rrrrDrFr r r assertIsNotbszTestCase.assertIsNotcCs~|j|td|j|td||krzdt||}ddjtjtj|jtj|j}|j ||}|j |j ||dS)Nz"First argument is not a dictionaryz#Second argument is not a dictionaryz%s != %sr) assertIsInstancerrrrrrrrrrrC)rZd1Zd2rDrFr r r rrhs   zTestCase.assertDictEqualc Cstjdtg}g}xX|jD]L\}}||kr:|j|q|||kr|jdt|t|t||fqW|pt|szdSd}|rddjdd|D}|r|r|d7}|d dj|7}|j|j||dS) Nz&assertDictContainsSubset is deprecatedz%s, expected: %s, actual: %srz Missing: %s,css|]}t|VqdS)N)r)r;ryr r rr=sz4TestCase.assertDictContainsSubset..z; zMismatched values: %s) rTrUrVitemsrrrrrC) rZsubsetZ dictionaryrDZmissingZ mismatchedkeyvaluerFr r rassertDictContainsSubsetts,     z!TestCase.assertDictContainsSubsetc Cst|t|}}ytj|}tj|}Wntk rHt||}YnX||krVdSt||}|rd}dd|D}dj|} |j|| }|j||}|j |dS)NzElement counts were not equal: cSsg|] }d|qS)z First has %d, Second has %d: %rr )r;r r r r sz-TestCase.assertCountEqual..r) rrCounterrRrrrrrCr) rrrrDZ first_seqZ second_seqZ differencesrFrrr r rassertCountEquals      zTestCase.assertCountEqualcCs|j|td|j|td||krt||jks@t||jkrN|j||||jdd}|jdd}t|dkr|jd|kr|dg}|dg}dt||}dd jt j ||}|j ||}|j |j ||dS) NzFirst argument is not a stringzSecond argument is not a stringT)keependsrz rz%s != %sr)rrr_diffThresholdrrrrrrrrrrC)rrrrDZ firstlinesZ secondlinesrFr r r rrs     zTestCase.assertMultiLineEqualcCs2||ks.dt|t|f}|j|j||dS)Nz%s not less than %s)rrrC)rabrDrFr r r assertLessszTestCase.assertLesscCs2||ks.dt|t|f}|j|j||dS)Nz%s not less than or equal to %s)rrrC)rr$r%rDrFr r rassertLessEqualszTestCase.assertLessEqualcCs2||ks.dt|t|f}|j|j||dS)Nz%s not greater than %s)rrrC)rr$r%rDrFr r r assertGreaterszTestCase.assertGreatercCs2||ks.dt|t|f}|j|j||dS)Nz"%s not greater than or equal to %s)rrrC)rr$r%rDrFr r rassertGreaterEqualszTestCase.assertGreaterEqualcCs,|dk r(dt|f}|j|j||dS)Nz%s is not None)rrrC)rr'rDrFr r r assertIsNoneszTestCase.assertIsNonecCs"|dkrd}|j|j||dS)Nzunexpectedly None)rrC)rr'rDrFr r rassertIsNotNoneszTestCase.assertIsNotNonecCs0t||s,dt||f}|j|j||dS)Nz%s is not an instance of %r)r-rrrC)rr'rrDrFr r rrs zTestCase.assertIsInstancecCs0t||r,dt||f}|j|j||dS)Nz%s is an instance of %r)r-rrrC)rr'rrDrFr r rassertNotIsInstances zTestCase.assertNotIsInstancecOst|||}|jd||S)NassertRaisesRegex)r]r\)rrrNr)r*rr r rr-s zTestCase.assertRaisesRegexcOst|||}|jd||S)NassertWarnsRegex)rkr\)rrrNr)r*rr r rr.s zTestCase.assertWarnsRegexcCsJt|ttfrtj|}|j|sFd|j|f}|j||}|j|dS)Nz&Regex didn't match: %r not found in %r) r-rbytesrLrMrcrdrCrE)rtextrNrDrFr r r assertRegexs    zTestCase.assertRegexcCs`t|ttfrtj|}|j|}|r\d||j|j|j|f}|j ||}|j |dS)Nz"Regex matched: %r matches %r in %r) r-rr/rLrMrcstartendrdrCrE)rr0Zunexpected_regexrDmatchrFr r rassertNotRegex&s   zTestCase.assertNotRegexcsfdd}|S)Ncs tjdjjtd||S)NzPlease use {0} instead.r)rTrUr_r rV)r)r*) original_funcr rdeprecated_func6s z,TestCase._deprecate..deprecated_funcr )r6r7r )r6r _deprecate5s zTestCase._deprecateii)r)N)N)N)N)NN)N)N)N)NNN)NNN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)\r r r AssertionErrorrErr r#Z_classSetupFailedrrrrr classmethodrrrrrrrrrrrr%r&_subtest_msg_sentinelrrrrrrrrrrrrrCrrrrrrrrrr rrrrrrrrrrr!rr&r'r(r)r*r+rr,r-r.r1r5r8ZfailUnlessEqualZ assertEqualsZ failIfEqualZassertNotEqualsZfailUnlessAlmostEqualZassertAlmostEqualsZfailIfAlmostEqualZassertNotAlmostEqualsZ failUnlessZassert_ZfailUnlessRaisesZfailIfZassertRaisesRegexpZassertRegexpMatchesZassertNotRegexpMatchesr r r rrfs!        E     !     ' c +      !               rcsfeZdZdfdd ZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ Z S)FunctionTestCaseNcs*tt|j||_||_||_||_dS)N)superr<r _setUpFunc _tearDownFunc _testFunc _description)rZtestFuncrrZ description)rr rrTs zFunctionTestCase.__init__cCs|jdk r|jdS)N)r>)rr r rr[s zFunctionTestCase.setUpcCs|jdk r|jdS)N)r?)rr r rr_s zFunctionTestCase.tearDowncCs |jdS)N)r@)rr r rrcszFunctionTestCase.runTestcCs|jjS)N)r@r )rr r rrfszFunctionTestCase.idcCs@t||jstS|j|jko>|j|jko>|j|jko>|j|jkS)N)r-rrr>r?r@rA)rrr r rris     zFunctionTestCase.__eq__cCstt||j|j|j|jfS)N)rr.r>r?r@rA)rr r rrrszFunctionTestCase.__hash__cCsdt|j|jjfS)Nz%s (%s))rrr@r )rr r rrvs zFunctionTestCase.__str__cCsdt|j|jfS)Nz <%s tec=%s>)rrr@)rr r rrzs zFunctionTestCase.__repr__cCs2|jdk r|jS|jj}|r.|jddjp0dS)Nrr)rAr@rrr)rrr r rr~s z!FunctionTestCase.shortDescription)NNN)r r r rrrrrrrrrr __classcell__r r )rrr<Ks  r<csDeZdZfddZddZddZddZd d Zd d ZZ S) rcs(tj||_||_||_|j|_dS)N)r=r_messager!rrE)rr!rvr)rr rrs  z_SubTest.__init__cCs tddS)Nzsubtests cannot be run directly)r)rr r rrsz_SubTest.runTestcCsbg}|jtk r |jdj|j|jrTdjddt|jjD}|jdj|dj|p`dS)Nz[{}]z, css|]\}}dj||VqdS)z{}={!r}N)r_)r;krur r rr=sz+_SubTest._subDescription..z({}) z ())rCr;rr_rrsortedr)rpartsZ params_descr r r_subDescriptions z_SubTest._subDescriptioncCsdj|jj|jS)Nz{} {})r_r!rrH)rr r rrsz _SubTest.idcCs |jjS)N)r!r)rr r rrsz_SubTest.shortDescriptioncCsdj|j|jS)Nz{} {})r_r!rH)rr r rrsz_SubTest.__str__) r r r rrrHrrrrBr r )rrrs   r)/rr/rrHrrrLrTrr%r`rrutilrrrrrZ __unittestobjectr;r  Exceptionr rrrr(r5r7r8rr:rBrJrKr]rk namedtupler|rrrrr<rr r r rsX (  /%5 ,l: