+
     Bi-                     v    ^ RI t ^ RIt^ RIt^RIHtHt ^RIHt Rt^t	Rt
RtR tR tR	 t ! R
 R]4      t]tR# )    N)loaderrunner)installHandlerTa  Examples:
  %(prog)s test_module               - run tests from test_module
  %(prog)s module.TestClass          - run tests from module.TestClass
  %(prog)s module.Class.test_method  - run specified test method
  %(prog)s path/to/test_file.py      - run tests from test_file.py
aF  Examples:
  %(prog)s                           - run default set of tests
  %(prog)s MyTestSuite               - run suite 'MyTestSuite'
  %(prog)s MyTestCase.testSomething  - run MyTestCase.testSomething
  %(prog)s MyTestCase                - run all 'test*' test methods
                                       in MyTestCase
c                 l   \         P                  P                  V 4      '       Ed   V P                  4       P	                  R 4      '       d   \         P                  P                  V 4      '       d   \         P                  P                  V \         P                  ! 4       4      p\         P                  P                  V4      '       g&   VP                  \         P                  4      '       d   V # Tp \         P                  P                  V 4      RR P                  RR4      P                  RR4      # V # )z.pyN\./)ospathisfilelowerendswithisabsrelpathgetcwd
startswithpardirnormpathreplace)namerel_paths   & $/usr/lib/python3.14/unittest/main.py_convert_namer      s    
 
ww~~d

 5 5e < <77==wwtRYY[9Hww}}X&&(*=*=bii*H*HD ww%cr*224=EEc3OOK    c                 B    V  Uu. uF  p\        V4      NK  	  up# u upi N)r   )namesr   s   & r   _convert_namesr   .   s    ,12EDM$E222s   c                 &    R V 9   g
   RV ,          p V # )*z*%s* )patterns   &r   _convert_select_patternr$   2   s    '>7"Nr   c                      a  ] tR t^8t o Rt^tR;t;t;t;t	;t
tRtRRRR]P                  R^RRRR3RRRR/R lltR tR	 tRR
 ltR tR tR tR tRR ltR tRtV tR# )TestProgramN__main__T	tb_localsF	durationsc               \   \        V\        4      '       dL   \        V4      V n        VP	                  R 4      R,           F  p\        V P                  V4      V n        K   	  MWn        Vf   \        P                  pW`n        Wn	        Wn
        Wpn        Wn        Wn        Wn        Vf   \        P                  '       g	   RV n        MWn        W n        W@n        WPn        \(        P*                  P-                  V^ ,          4      V n        V P1                  V4       V P3                  4        R# )r      NNNdefault)
isinstancestr
__import__modulesplitgetattrsysargvexitfailfast
catchbreak	verbositybufferr(   r)   warnoptionswarningsdefaultTest
testRunner
testLoaderr   r   basenameprogName	parseArgsrunTests)selfr1   r=   r5   r>   r?   r6   r9   r7   r8   r:   r<   r(   r)   parts   &&&&&&&&&&&&$$ r   __init__TestProgram.__init__B   s    
 fc""$V,DKS)"--%dkk48 . !K<88D	 $"""COOO &DM %M&$$((a1tr   c                n   V P                   fb   \        V P                  P                  4       4       \        \        RV P
                  /,          4       V P                  P                  4        R # \        V P                  P                  4       4       \        \        RV P
                  /,          4       R # )Nprog)	r1   print_main_parserformat_helpMAIN_EXAMPLESrA   _discovery_parser
print_helpMODULE_EXAMPLES)rD   argskwargss   &*,r   _print_helpTestProgram._print_helpj   sx    ;;$##//12-64=="99:""--/$##//12/VT]]$;;<r   c                
   V P                  4        V P                  f   \        V4      ^8  d7   V^,          P                  4       R8X  d   V P	                  VR,          4       R # V P
                  P                  VR,          V 4       V P                  '       g   V P	                  . 4       R # M#V P
                  P                  VR,          V 4       V P                  '       d.   \        V P                  4      V n	        \        R8X  d   R V n        McV P                  f	   R V n	        MM\        V P                  \        4      '       d   V P                  3V n	        M\        V P                  4      V n	        V P                  4        R # )Ndiscover:   NNr+   r'   )_initArgParsersr1   lenr   _do_discoveryrK   
parse_argstestsr   	testNames__name__r=   r.   r/   listcreateTests)rD   r5   s   &&r   rB   TestProgram.parseArgss   s   ;;4y1}aJ!>""48,((b48::: ""2&	  ((b48:::+DJJ7DN:%"%!DN((#.."..0DN!$"2"23DNr   c                   V P                   '       d   V P                   V P                  n         V'       dQ   Vf   V P                  MV! 4       pVP                  ! V P                  V P                  V P
                  4      V n        R # V P                  f-   V P                  P                  V P                  4      V n        R # V P                  P                  V P                  V P                  4      V n        R # r   )testNamePatternsr?   rV   startr#   toptestr]   loadTestsFromModuler1   loadTestsFromNames)rD   from_discoveryLoaderr   s   &&& r   r`   TestProgram.createTests   s       /3/D/DDOO,(.T__FHF

DLL$((KDI^^#;;DKKHDI::4>>;?;;HDIr   c                ~    V P                  4       pV P                  V4      V n        V P                  V4      V n        R # r   )_getParentArgParser_getMainArgParserrK   _getDiscoveryArgParserrN   )rD   parent_parsers   & r   rX   TestProgram._initArgParsers   s6    002 22=A!%!<!<]!Kr   c           	     P   \         P                  ! R R7      pVP                  RRRR^RR7       VP                  RR	RR^ R
R7       VP                  RRRRR7       VP                  RR\        RRRR7       V P                  f   VP                  RRRRRR7       R V n        V P
                  f   VP                  RRRRRR7       R V n        V P                  f   VP                  RRR RR!R7       R V n        V P                  f"   VP                  R"R#R$\        R%R&7       . V n        V# )'F)add_helpz-vz	--verboser9   store_constzVerbose output)destactionconsthelpz-qz--quietzQuiet outputz--localsr(   
store_truez"Show local variables in tracebacks)ru   rv   rx   z--durationsr)   NNz+Show the N slowest test cases (N=0 for all))ru   typer-   metavarrx   z-fz
--failfastr7   zStop on first fail or errorz-cz--catchr8   z'Catch Ctrl-C and display results so farz-bz--bufferr:   z%Buffer stdout and stderr during testsz-krc   appendz.Only run tests which match the given substring)ru   rv   r{   rx   )	argparseArgumentParseradd_argumentintr7   r8   r:   rc   r$   )rD   parsers   & r   rm   TestProgram._getParentArgParser   sr   ((%8D+K#0!1 	 	3 	D)+#0!/ 	 	1 	J[#/!E 	 	G 	M#$(#!N 	 	P == l'3%B   D "DM??"il'3%N   P $DO;;jx'3%L   N  DK  (+='/6M%U   W %'D!r   c                    \         P                  ! V.R R7      pV P                  Vn        V P                  Vn        VP                  RRRR7       V# )Tparentscolorr\   r!   z?a list of any number of test modules, classes and test methods.)nargsrx   )r~   r   rA   rI   rS   rO   r   )rD   parentr   s   && r   rn   TestProgram._getMainArgParser   sR    ((&Fmm ,,G3"8 	 	9 r   c                h   \         P                  ! V.R R7      pRV P                  ,          Vn        RVn        VP                  RRRRR7       VP                  R	R
RRR7       VP                  RRRRR7       R F4  pVP                  VR\         P                  \         P                  R7       K6  	  V# )Tr   z%s discoverzcFor test discovery all test modules must be importable from the top level directory of the project.z-sz--start-directoryrd   z*Directory to start discovery ('.' default))ru   rx   z-pz	--patternr#   z+Pattern to match tests ('test*.py' default)z-tz--top-level-directoryre   z<Top level directory of project (defaults to start directory)?)r   r-   rx   )rd   r#   re   )r~   r   rA   rI   epilogr   SUPPRESS)rD   r   r   args   &&  r   ro   "TestProgram._getDiscoveryArgParser   s    ((&F#dmm3$ 	D"5G!M 	 	OD+I!N 	 	PD"9"4 	 	5 /C3(0(9(9%-%6%6   8 /
 r   c                    R V n         RV n        RV n        Ve:   V P                  f   V P	                  4        V P                  P                  W4       V P                  RVR7       R# )r   ztest*.pyNT)ri   rj   )rd   r#   re   rN   rX   r[   r`   )rD   r5   rj   s   &&&r   rZ   TestProgram._do_discovery   s\    
!%%-$$&""--d9V<r   c           	     $   V P                   '       d   \        4        V P                  f   \        P                  V n        \        V P                  \        4      '       dW     V P                  V P                  V P                  V P                  V P                  V P                  V P                  R7      pMV P                  pVP                  V P                  4      V n        V P"                  '       d   V P                   P$                  ^ 8X  dA   \'        V P                   P(                  4      ^ 8X  d   \*        P"                  ! \,        4       R # V P                   P/                  4       '       d   \*        P"                  ! ^ 4       R # \*        P"                  ! ^4       R # R #   \         dB    T P                  T P                  T P                  T P                  T P                  R7      p EL*i ; i  \         d    T P                  4       p ELLi ; i)N)r9   r7   r:   r<   r(   r)   )r9   r7   r:   r<   )r8   r   r>   r   TextTestRunnerr.   r{   r9   r7   r:   r<   r(   r)   	TypeErrorrunrf   resultr6   testsRunrY   skippedr4   _NO_TESTS_EXITCODEwasSuccessful)rD   r>   s   & r   rC   TestProgram.runTests   sj   ?????"$33DOdoot,,/I!%4>>:>--8<:>--;?>>;?>> "1 "KJ" J nnTYY/999{{##q(S1D1D-E-J+,**,,  ! I!%4>>:>--8<:>-- "1 "IJI  /!__.
/s,   "AF! !AG-)G0 ,G--G0 0HH)rN   rK   r:   r8   r=   r)   r6   r7   r1   r#   rA   r   rd   r(   rf   r?   rc   r]   r>   re   r9   r<   )FNr   )r^   
__module____qualname____firstlineno__r1   r9   r7   r8   r:   rA   r<   rc   rN   r   defaultTestLoaderrF   rS   rB   r`   rX   rm   rn   ro   rZ   rC   __static_attributes____classdictcell__)__classdict__s   @r   r&   r&   8   s     
 FINRRHRzRFRXR;K(d#0H0HTd$& >C& #	&P=:
HL
$L	*=! !r   r&   )r4   r~   r    r   r   signalsr   
__unittestr   rM   rP   r   r   r$   objectr&   mainr"   r   r   <module>r      sT      	  #
  3]& ]@ r   