Wc4dZddlZddlmZddlmZdZdZGdd eZGd deZ Gd d eZ d Z GddeZ dS) TestSuiteN)case)utilTc6t||d}|dS)NcdSNr '/usr/lib64/python3.12/unittest/suite.pyz!_call_if_exists.. sr )getattr)parentattrfuncs r _call_if_existsr s 64 .DDFFFFr cZeZdZdZdZddZdZdZdZdZ d Z d Z d Z d Z d ZdZdS) BaseTestSuitezNA simple test suite that doesn't provide class or module shared fixtures. Tr cFg|_d|_|j|dSNr)_tests_removed_testsaddTests)selftestss r __init__zBaseTestSuite.__init__s&  er chdtj|jdt|dS)N)rstrclass __class__listrs r __repr__zBaseTestSuite.__repr__s*"&--"?"?"?dLLr cxt||jstSt|t|kSr ) isinstancer!NotImplementedr")rothers r __eq__zBaseTestSuite.__eq__s,%00! !DzT%[((r c0t|jSr )iterrr#s r __iter__zBaseTestSuite.__iter__"sDKK  r cX|j}|D]}|s||jz }|Sr )rcountTestCases)rcasestests r r.zBaseTestSuite.countTestCases%s<## / /Dt,,.. r c0t|s(tdjt|t |t r1t |tjtfr td|jj|dS)Nz{} is not callablezNTestCases and TestSuites must be instantiated before passing them to addTest()) callable TypeErrorformatreprr&type issubclassrTestCaserrappendrr0s r addTestzBaseTestSuite.addTest,s~~~077T CD D dD ! !j26--1K'M'M?@ @ 4    r cvt|tr td|D]}|j|dS)Nz0tests must be an iterable of tests, not a string)r&strr3r;)rrr0s r rzBaseTestSuite.addTests6sF eS ! !NO O  D LL     r ct|D]<\}}|jr|S|||js+|j|>|Sr ) enumerate shouldStop_cleanup_removeTestAtIndex)rresultindexr0s r runzBaseTestSuite.run<s_$T? / /KE4     DLL}}}''... r c |j|}t|dr$|xj|jz c_d|j|<dS#t$rYdSwxYw)z2Stop holding a reference to the TestCase at index.r.N)rhasattrrr.r3)rrDr0s r rBz BaseTestSuite._removeTestAtIndexEs} &;;u%Dt-..###t':':'<<##!%DKK       DD sA A%$A%c&|j|i|Sr rE)rargskwdss r __call__zBaseTestSuite.__call__Sstxx&&&&r c4|D]}|jdS)7Run the tests without collecting errors in a TestResultN)debugr:s r rOzBaseTestSuite.debugVs(  D JJLLL  r N)r )__name__ __module__ __qualname____doc__rArr$r)r,r.r;rrErBrLrOr r r rrsH MMM))) !!!!!!  & & &'''r rcReZdZdZd 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. FcVd}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)rrVr?r@ _isnotsuite_tearDownPreviousClass_handleModuleFixture_handleClassSetUpr!_previousTestClassrOrArB_handleModuleTearDown)rrCrOtopLevelrDr0s r rEz 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 " r cDt}|j|ddS)rNTN) _DebugResultrE)rrOs r rOzTestSuite.debugs  r ct|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) rr!rXrWr3r Exceptionr&rarr "_createClassOrModuleLevelExceptiontearDown_exceptions) rr0rC previousClass currentClassfailedrdree 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,,,,r cb|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) rurXrxryrzrrrjr&rarkrr{)rrCrtr}rrps r r^zTestSuite._handleModuleTearDowns226:  ! F  $ $ $ F [[0F // 6$V-=tDN)L"N$$ H%%'' F$4 5 5 5 51    FF !LLL!&,77;;FArs       IIIIIFIIXi6i6i6i6i6 i6i6X$$$$$6$$L6r