+
    i4  c                   s    R t ^ RIt^RIHt ^RIHt RtR t ! R R]4      t ! R R ]4      t	 ! R	 R
]4      t
R t ! R R]4      tR# )	TestSuiteN)case)utilTc                 s.    \        WR  4      pV! 4        R# )c                      R # N r       '/usr/lib64/python3.14/unittest/suite.pyZ<lambda>Z!_call_if_exists.<locals>.<lambda>   s    r   N)getattr)parentZattrZfunc   && r   _call_if_existsr      s    6.DFr   c                   sn   a  ] tR t^t o RtRtRR ltR tR tR t	R t
R tR	 tR
 tR tR tR tRtV tR# )BaseTestSuitezNA simple test suite that doesn't provide class or module shared fixtures.
    Tc                sD    . V n         ^ V n        V P                  V4       R# )    N)_tests_removed_testsaddTests)selftests   &&r   __init__ZBaseTestSuite.__init__   s    er   c                sf    R \         P                  ! V P                  4      : R\        V 4      : R2# )Z<z tests=>)r   strclass	__class__listr      &r   __repr__ZBaseTestSuite.__repr__   s    "&--"?dLLr   c                sr    \        WP                  4      '       g   \        # \        V 4      \        V4      8H  # r   )
isinstancer   ZNotImplementedr   )r   Zotherr   r   __eq__ZBaseTestSuite.__eq__   s*    %00!!DzT%[((r   c                s,    \        V P                  4      # r   )iterr   r   r   r   __iter__ZBaseTestSuite.__iter__"   s    DKK  r   c                sp    V P                   pV  F#  pV'       g   K  WP                  4       ,          pK%  	  V# r   )r   countTestCases)r   Zcasestests   &  r   r    ZBaseTestSuite.countTestCases%   s4    ##Dt,,..  r   c                s2   \        V4      '       g$   \        R P                  \        V4      4      4      h\	        V\
        4      '       d2   \        V\        P                  \        34      '       d   \        R4      hV P                  P                  V4       R# )z{} is not callablezNTestCases and TestSuites must be instantiated before passing them to addTest()N)Zcallable	TypeErrorZformatZreprr   ZtypeZ
issubclassr   ZTestCaser    r   Zappendr   r!   r   r   addTestZBaseTestSuite.addTest,   su    ~~077T
CDDdD!!j26--1K'M 'M ? @ @4 r   c                s|    \        V\        4      '       d   \        R 4      hV F  pV P                  V4       K  	  R# )z0tests must be an iterable of tests, not a stringN)r   strr"   r$   )r   r   r!   r
   r   r   ZBaseTestSuite.addTests6   s1    eS!!NOODLL r   c                s    \        V 4       FG  w  r#VP                  '       d    V# V! V4       V P                  '       g   K6  V P                  V4       KI  	  V# r   )	enumerate
shouldStop_cleanup_removeTestAtIndex)r   resultindexr!      &&  r   runZBaseTestSuite.run<   sO    $T?KE     L}}}''. + r   c                s     V P                   V,          p\        VR4      '       d(   V ;P                  VP                  4       ,          un        RV P                   V&   R#   \         d     R# i ; i)z2Stop holding a reference to the TestCase at index.r    N)r   Zhasattrr   r    r"   )r   r+   r!   r
   r   r)   Z BaseTestSuite._removeTestAtIndexE   sa    
	&;;u%D t-..##t':':'<<#!%DKK  		s   A A.-A.c                s&    V P                   ! V/ VB # r   r-   )r   ZargsZkwdss   &*,r   __call__ZBaseTestSuite.__call__S   s    xx&&&r   c                s8    V  F  pVP                  4        K  	  R# )7Run the tests without collecting errors in a TestResultN)debugr#      & r   r1   ZBaseTestSuite.debugV   s    DJJL r   )r   r   N)r   )__name__
__module____qualname____firstlineno____doc__r(   r   r   r   r   r    r$   r   r-   r)   r/   r1   __static_attributes____classdictcell__Z__classdict__   @r   r   r      sL     H
M)
!!&' r   r   c                   sf   a  ] tR t^\t o RtRR ltR tR tR tR t	RR lt
RR	 ltR
 tR tRtV tR# )r    a  A 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.
c                s   R p\        VRR 4      R J d
   R;Vn        p\        V 4       F  w  rEVP                  '       d    M\	        V4      '       dw   V P                  WQ4       V P                  WQ4       V P                  WQ4       VP                  Vn	        \        VP                  RR 4      '       g   \        VRR 4      '       d   K  V'       g
   V! V4       MVP                  4        V P                  '       g   K  V P                  V4       K  	  V'       d+   V P                  RV4       V P                  V4       R Vn        V# )F_testRunEnteredT_classSetupFailed_moduleSetUpFailedN)r   r<   r&   r'   _isnotsuite_tearDownPreviousClass_handleModuleFixture_handleClassSetUpr   _previousTestClassr1   r(   r)   _handleModuleTearDown)r   r*   r1   ZtopLevelr+   r!   s   &&&   r   r-   ZTestSuite.runf   s   6,e4=044F"X$T?KE   4  ++D9))$7&&t4,0NN)DNN,?GGF$8%@@V

}}}''.) +, ''f5&&v.%*F"r   c                s>    \        4       pV P                  VR4       R# )r0   TN)_DebugResultr-   )r   r1   r2   r   r1   ZTestSuite.debug   s    r   c           	     s   \        VR R4      pVP                  pWC8X  d   R# VP                  '       d   R# \        VRR4      '       d   R# Rp RVn        \        VRR4      p\        VRR4      pVef   \        VR4         V! 4        V'       d;   Ve7   V! 4        VP                   F  p
V P                  W*^,          RX	V
R7       K!  	  \        VR	4       R# R#   \         d     Li ; i  \         dg   p\        T\        4      '       d   h Rp RTn        M  \         d     Mi ; i\        P                  ! T4      p	T P                  Y(RT	4        Rp?LRp?ii ; i  \        TR	4       i ; i)
rC   N__unittest_skip__F
setUpClassdoClassCleanups_setupStdoutTinfo_restoreStdout)r   r   r>   r=   r"   r   	Exceptionr   rE   r   r   "_createClassOrModuleLevelExceptiontearDown_exceptions)r   r!   r*   previousClasscurrentClassZfailedrG   rH   e	classNameexc_infos   &&&        r   rB   ZTestSuite._handleClassSetUp   s   (<dC~~($$$<!4e<<	-2L* \<>
!,0A4H!FN3:GL o9#%$0$D$D?? &\9%- @ / %E
  (891 "  	 	 ! G!&,77!F9=6$  $l ;I;;F<H<EG GG&  (89sl   C C+ E :E C('C(+E6EDED&#E%D&&,EE EE E-c                sD    R p\        VRR 4      pVe   VP                  pV# )NrC   )r   r4   )r   r*   previousModulerP   r,   r   _get_previous_moduleZTestSuite._get_previous_module   s-    (<dC$*55Nr   c                s   V P                  V4      pVP                  P                  pWC8X  d   R # V P                  V4       RVn         \
        P                  V,          p\        TRR 4      pTeL   \        TR4         T! 4        TP                  '       d    \        P                  ! 4        \        TR4       R # R #   \         d     R # i ; i  \         d<   p\        T\        4      '       d   h RTn        T P                  Y'RT4        R p?LR p?ii ; i  \         d   pT P                  Y'RT4        R p?LR p?ii ; i  \        TR4       i ; i)NFsetUpModulerI   TrL   )rV   r   r4   rD   r>   sysmodulesKeyErrorr   r   rM   r   rE   rN   r   doModuleCleanups)r   r!   r*   rU   ZcurrentModulemodulerW   rR   s   &&&     r   rA   ZTestSuite._handleModuleFixture   sQ   226:11*""6* %*!	[[/F fmT:"FN3:KM ,,,O--/  (89) #  		 ! K!&,7704F-;;F<I<IK K	K % O??@M@MO OO
  (89sf   	B> ?C E D >CCD1DE DE E$D<7E <EE ENc                s:    V R V R2pV P                  WWe4       R# )z (Z)N)_addClassOrModuleLevelException)r   r*   ZexcZmethod_namer	   rK   	errorNames   &&&&&& r   rN   Z,TestSuite._createClassOrModuleLevelException   s$    "m2fXQ/	,,V)Jr   c                s&   \        V4      p\        VR R4      pVe5   \        V\        P                  4      '       d   V! V\        V4      4       R# V'       g(   VP                  V\        P                  ! 4       4       R# VP                  WT4       R# )addSkipN)	_ErrorHolderr   r   r   ZSkipTestr%   ZaddErrorrX   rT   )r   r*   Z	exceptionr^   rK   Zerrorr_   s   &&&&&  r   r]   Z)TestSuite._addClassOrModuleLevelException   sa    Y'&)T2:i#G#GE3y>*s||~6,r   c                sj   V P                  V4      pVf   R # VP                  '       d   R #  \        P                  V,          p\        TR4        \        TRR 4      pTe	    T! 4         \        P                  ! 4        \        TR4       R #   \         d     R # i ; i  \         d5   p\        T\        4      '       d   h T P                  YRT4        R p?LpR p?ii ; i  \         d5   p\        T\        4      '       d   h T P                  YRT4        R p?LR p?ii ; i  \        TR4       i ; i)NrI   tearDownModulerL   )rV   r>   rX   rY   rZ   r   r   rM   r   rE   rN   r   r[   )r   r*   rU   r\   ra   rR   s   &&    r   rD   ZTestSuite._handleModuleTearDown   s0   226:!$$$	[[0F 	/	6$V-=tDN)L"$H%%' F$451  		 ! L!&,77;;F<L<JL LL  Hfl33778H8FH HH F$45se   B D$ #B  +C" BB C+*CD$ CD$ "D!-*DD$ D!!D$ $D2c           	     s   \        VR R4      pVP                  pWC8X  g   Vf   R# \        VRR4      '       d   R# \        VRR4      '       d   R# \        VRR4      '       d   R# \        VRR4      p\        VRR4      pVf   Vf   R# \        VR4        Ve	    V! 4        Vel   V! 4        VP                   FT  p	\	        V\
        4      '       d
   V	^,          h\        P                  ! V4      pV P                  W)^,          RVV	R	7       KV  	  \        VR
4       R#   \         dK   p\	        T\
        4      '       d   h \        P                  ! T4      pT P                  Y'RT4        Rp?LRp?ii ; i  \        TR
4       i ; i)rC   Nr=   Fr>   rF   tearDownClassrH   rI   rJ   rL   )
r   r   r   rM   r   rE   r   r   rN   rO   )
r   r!   r*   rP   rQ   rb   rH   rR   rS   rT   s
   &&&       r   r@   Z TestSuite._tearDownPreviousClass  s}   (<dC~~(M,A="5u==6/77="5u==E!-1BDI _%</	6(G!O *! - A AH!&,77&qk) $m <I;;FQK<K<EAI < K	 !B F$45% ! G!&,77 $m <I;;F<K<EG G	G$ F$45s8   E7 D "A/E7 E4*A E/*E7 /E44E7 7Fr   )Fr   )r3   r4   r5   r6   r7   r-   r1   rB   rV   rA   rN   r]   rD   r@   r8   r9   r:   r;   r   r    r    \   sA     B,:\#:JK

-!6F(6 (6r   c                   sX   a  ] tR tRt o RtRtR tR tR tR t	R t
R	 tR
 tR tRtV tR# )r`   iH  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.
Nc                s    Wn         R # r   description)r   rd   r   r   r   Z_ErrorHolder.__init__T  s    &r   c                s    V P                   # r   rc   r   r   r   idZ_ErrorHolder.idW  s    r   c                r   r   r   r   r   r   shortDescriptionZ_ErrorHolder.shortDescriptionZ  s    r   c                s$    R V P                   : R2# )z<ErrorHolder description=r   rc   r   r   r   r   Z_ErrorHolder.__repr__]  s    151A1ACCr   c                s"    V P                  4       # r   )re   r   r   r   __str__Z_ErrorHolder.__str__`  s    wwyr   c                r   r   r   r   r*   r   r   r-   Z_ErrorHolder.runc  s     	r   c                s$    V P                  V4      # r   r.   rh   r   r   r/   Z_ErrorHolder.__call__h  s    xxr   c                s    ^ # )r   r   r   r   r   r    Z_ErrorHolder.countTestCasesk  s    r   rc   )r3   r4   r5   r6   r7   ZfailureExceptionr   re   rf   r   rg   r-   r/   r    r8   r9   r:   r;   r   r`   r`   H  s@      ' D
  r   r`   c                sB     \        V 4       R#   \         d     R# i ; i)z?A crude way to tell apart testcases and suites with duck-typingTF)r   r"   )r!   r   r   r?   r?   n  s'    T
   s    c                   s&    ] tR tRtRtRtRtRtRtR# )rE   iw  zCUsed by the TestSuite to hold previous class when running in debug.NFr   )	r3   r4   r5   r6   r7   rC   r>   r'   r8   r   r   r   rE   rE   w  s    IJr   rE   )r7   rX   Z r   r   Z
__unittestr   Zobjectr   r    r`   r?   rE   r   r   r   <module>ri      sW     
  

IF IXi6 i6X$6 $L6 r   