Wc4csdZddlZddlmZddlmZdZdZGdd eZGd deZ Gd d eZ d Z GddeZ dS) TestSuiteN)case)utilTcs6t||d}|dS)NcdSNr'/usr/lib64/python3.12/unittest/suite.pyzz!_call_if_exists.. sr)getattr)parentZattrZfunc r _call_if_existsr s 64 .DDFFFFrcsZeZdZdZdZddZdZdZdZdZ d Z d Z d Z d Z d ZdZdS) BaseTestSuitezNA simple test suite that doesn't provide class or module shared fixtures. TrcsFg|_d|_|j|dSNr)_tests_removed_testsaddTests)selftests r __init__zBaseTestSuite.__init__s&  ercshdtj|jdt|dS)Nz)rstrclass __class__listr r __repr__zBaseTestSuite.__repr__s*"&--"?"?"?dLLrcsxt||jstSt|t|kSr) isinstancerZNotImplementedr)rZotherrr __eq__zBaseTestSuite.__eq__s,%00! !DzT%[((rcs0t|jSr)iterrrrr __iter__zBaseTestSuite.__iter__"sDKK  rcsX|j}|D]}|s||jz }|Sr)rcountTestCases)rZcasestestr r r"zBaseTestSuite.countTestCases%s<## / /Dt,,.. rcs0t|s(tdjt|t |t r1t |tjtfr td|jj|dS)Nz{} is not callablezNTestCases and TestSuites must be instantiated before passing them to addTest()) Zcallable TypeErrorZformatZreprrZtypeZ issubclassrZTestCaserrZappendrr#rr addTestzBaseTestSuite.addTest,s~~~077T CD D dD ! !j26--1K'M'M?@ @ 4    rcsvt|tr td|D]}|j|dS)Nz0tests must be an iterable of tests, not a string)rstrr$r&)rrr#r r rzBaseTestSuite.addTests6sF eS ! !NO O  D LL     rcst|D]<\}}|jr|S|||js+|j|>|Sr) enumerate shouldStop_cleanup_removeTestAtIndex)rresultindexr# r runzBaseTestSuite.run<s_$T? / /KE4     DLL}}}''... rcs |j|}t|dr$|xj|jz c_d|j|<dS#t$rYdSwxYw)z2Stop holding a reference to the TestCase at index.r"N)rZhasattrrr"r$)rr-r#r r r+z BaseTestSuite._removeTestAtIndexEs} &;;u%Dt-..###t':':'<<##!%DKK       DD sA A%$A%cs&|j|i|Srr/)rZargsZkwdsr r __call__zBaseTestSuite.__call__Sstxx&&&&rcs4|D]}|jdS)7Run the tests without collecting errors in a TestResultN)debugr%rr r3zBaseTestSuite.debugVs(  D JJLLL  rN)r)__name__ __module__ __qualname____doc__r*rrrr!r"r&rr/r+r1r3rrr rrsH MMM))) !!!!!!  & & &'''rrcsReZdZdZd dZdZdZdZdZ dd Z dd Z d Z d Z dS)raA test suite is a composite test consisting of a number of TestCases. For use, create an instance of TestSuite, then add test case instances. When all tests have been added, the suite can be passed to a test runner, such as TextTestRunner. It will run the individual test cases in the order in which they were added, aggregating the results. When subclassing, do not forget to call the base class constructor. FcsVd}t|dddur dx|_}t|D]\}}|jrnt |rs|j |||j |||j|||j|_ t|jddst|ddr|s ||n|j|js|j||r,|j d||j|d|_|S)NF_testRunEnteredT_classSetupFailed_moduleSetUpFailed)r r8r(r) _isnotsuite_tearDownPreviousClass_handleModuleFixture_handleClassSetUpr_previousTestClassr3r*r+_handleModuleTearDown)rr,r3ZtopLevelr-r# r r/z TestSuite.runfs9 6,e 4 = =04 4F "X$T? / /KE4   4  ++D&99))$77&&tV44,0NN)DNN,?GGF$8%@@5V  }}}''... 8  ' 'f 5 5  & &v . .%*F " rcsDt}|j|ddS)r2TN) _DebugResultr/)rr3rr r3zTestSuite.debugs  rcst|dd}|j}||krdS|jrdSt|ddrdSd} d|_t|dd}t|dd}|at |d ||r7|5||jD]} |j|| dd | !t |d dSdS#t$rYwxYw#t $re}t|trd} d|_n#t$rYnwxYwtj|} |j||d| Yd}~d}~wwxYw#t |d wxYw) Nr?__unittest_skip__F setUpClassdoClassCleanups _setupStdoutTrinfo_restoreStdout) r rr:r9r$r ExceptionrrBrr"_createClassOrModuleLevelExceptiontearDown_exceptions) rr#r, previousClass currentClassZfailedrDrEe classNameexc_infos r r>zTestSuite._handleClassSetUps( !,0A4H  ! FN 3 3 : GJLL6o9#O%%$0$D$D//?? & \9%-@/// (899991 " !    D ! G G G!&,77!F9= 66$ $ l ;I;;FA * * * *4s||~6666t,,,,rcsb|j|}|dS|jrdS tj|}t |d t |dd}| | tjt |ddS#t$rYdSwxYw#t$r3}t|tr|j||d|Yd}~pd}~wwxYw#t$r3}t|tr|j||d|Yd}~d}~wwxYw#t |dwxYw)NrFtearDownModulerI) rSr:rUrVrWr r rJrrBrKrrX)rr,rRrYr_rOrAr r@zTestSuite._handleModuleTearDowns226:  ! F  $ $ $ F [[0F // 6$V-=tDN)L"N$$ H%%'' F$4 5 5 5 51    FF !LLL!&,77;;FArSr=rKrZr@r<rrr rr\sB,:,:,:\#:#:#:L9=KKKK .2 - - - -!6!6!6F(6(6(6(6(6rcsFeZdZdZdZdZdZdZdZdZ dZ d Z d Z dS) r^z 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. Ncs||_dSr description)rrbrr rz_ErrorHolder.__init__Ts&rcs|jSrrarrr idz_ErrorHolder.idWsrcrrrrrr shortDescriptionz_ErrorHolder.shortDescriptionZstrcs"d|jdS)Nzrgs       IIIIIFIIXi6i6i6i6i6 i6i6X$$$$$6$$L6r