+
    Dfj܍                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
Ht ^ RIHt ^ RIHtHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHtHt ^ RIHt ^ RIHt ^ RI Ht ^ RI!H"t" ^ RI#H$t$ ^ RI%H&t&H't'H(t(H)t)H*t* ^ RI+H,t, ^RI-H.t. ]/! R4      t0R R lt1R R lt2R R lt3R R lt4]$! ]4]34      t5 ! R R]Pl                  4      t7 ! R R ]Pl                  4      t8 ! R! R"]Pl                  4      t9 ! R# R$]Pl                  4      t: ! R% R&]Pl                  4      t; ! R' R(]Pl                  4      t< ! R) R*]Pl                  4      t= ! R+ R,]P|                  4      t? ! R- R.]P|                  4      t@ ! R/ R0]P|                  4      tA ! R1 R2]P|                  4      tB ! R3 R4]P|                  4      tC ! R5 R6]P|                  4      tDR# )7    )annotationsN)StringIO)List)skipIf)assert_thatcontains_string)given)sampled_from)Logger)util)FilePath	IFilePath)
UsageError)trial)unittest)DistTrialRunner)compose)DestructiveTestSuite
TestLoader	TestSuiteTrialRunner_Runner)	testNames)fileContentsr   c                    V ^8  d   QhRRRR/# )   filenamestrreturn )formats   "@/usr/lib/python3/dist-packages/twisted/trial/test/test_script.py__annotate__r#   (   s     , ,c ,c ,    c                8    \         P                  ! \        V 4      # )z)
For finding files in twisted/trial/test
)r   sibpath__file__)r   s   &r"   r&   r&   (   s     <<(++r$   c                   V ^8  d   QhRR/# r   r   Noner    )r!   s   "r"   r#   r#   /   s      d r$   c                 8    \        4       P                  R4       R# )z&
Emit something to L{twisted.logger}.
	somethingN)r   infor    r$   r"   logSomethingr.   /   s     HMM+r$   c                    V ^8  d   QhRRRR/# )r   argvz	List[str]r   trial.Optionsr    )r!   s   "r"   r#   r#   6   s       } r$   c                R    \         P                  ! 4       pVP                  V 4       V# )z7
Parse an argument list using trial's argument parser.
)r   OptionsparseOptions)r0   configs   & r"   parseArgumentsr6   6   s"     ]]_F
Mr$   c                    V ^8  d   QhRRRR/# )r   r5   r1   r   r    )r!   s   "r"   r#   r#   ?   s      - M r$   c                    \         P                  ! V 4      p\        4       Vn        \	        \
        P                  \        4      .4      pVP                  V4       V # )zE
Run L{logSomething} as a test method using the given configuration.
)	r   _makeRunnerr   streamr   pyunitFunctionTestCaser.   run)r5   runnersuites   &  r"   runFromConfigr@   ?   sF     v&FJFMv..|<=>E
JJuMr$   c                      ] tR t^MtRt]! ]! . RO4      4      R R l4       t]! ]! RR.4      4      R R l4       t]! ]! RR.4      4      R R	 l4       t	R
t
R# )LogfileTestsz!
Tests for the --logfile option.
c                    V ^8  d   QhRRRR/# )r   workingDirectoryr   r   r*   r    )r!   s   "r"   r#   LogfileTests.__annotate__[   s     I IS IT Ir$   c                    \        RV.4      p\        V4      P                  VR,          4      p\        V\	        \        R4      4      4       R# )zk
If no value is given for the option then logs are written to a log
file constructed from a default value.
--temp-directorylogfiler,   NrunFromArgumentsr   preauthChildr   r   r   )selfrD   r5   logPaths   &&  r"   test_defaultLogfileTests.test_defaultR   sD     "#57G"HI%&67DDVIEVWG\/+*FGHr$   zsomelog.txtzsomedir/somelog.txtc                    V ^8  d   QhRRRR/# r   rH   r   r   r*   r    )r!   s   "r"   r#   rE   l   s     I I I Ir$   c                    \        RV.4      p\        VR,          4      P                  V4      p\        V\	        \        R4      4      4       R# )z
If the value given for the option is a relative path then it is
interpreted relative to trial's own temporary working directory and
logs are written there.
	--logfiletemp-directoryr,   NrI   )rL   rH   r5   rM   s   &&  r"   test_relativePathLogfileTests.test_relativePathd   sB     ";"89%f-=&>?LLWUG\/+*FGHr$   c                    V ^8  d   QhRRRR/# rQ   r    )r!   s   "r"   r#   rE   ~   s     G G G Gr$   c                    \        R4      P                  V4      p\        RVP                  .4       Tp\	        V\        \        R4      4      4       R# )zu
If the value given for the option is an absolute path then it is
interpreted absolutely and logs are written there.
.rS   r,   N)r   rK   rJ   pathr   r   r   )rL   rH   rM   iPaths   &&  r"   test_absolutePathLogfileTests.test_absolutePathv   sB    " 3-,,W5+w||45"E<(DEFr$   r    N)zdir-azdir-bzdir-c/dir-d)__name__
__module____qualname____firstlineno____doc__r	   r
   rN   rU   r\   __static_attributes__r    r$   r"   rB   rB   M   s     	
II %	
II %	
GGr$   rB   c                  b    ] tR t^tRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
RtR# )ForceGarbageCollectionTestsz"
Tests for the --force-gc option.
c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   (ForceGarbageCollectionTests.__annotate__   s     , ,t ,r$   c                	    \         P                  ! 4       V n        . V n        V P	                  \
        R V P                  4       \        P                  V P                  4      p\        W.4      V n        R# )collectN)r   r3   r5   logpatchgcri   r;   r<   
simpleTestr   test)rL   rn   s   & r"   setUp!ForceGarbageCollectionTests.setUp   sL    mmo 

2y$,,/&&t7tl+	r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rg      s        D  r$   c                <    V P                   P                  R4       R# )z4
A simple test method that records that it was run.
rn   Nrj   appendrL   s   &r"   rm   &ForceGarbageCollectionTests.simpleTest   s     	r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rg      s     # # #r$   c                <    V P                   P                  R4       R# )z9
A replacement for gc.collect that logs calls to itself.
ri   Nrs   ru   s   &r"   ri   #ForceGarbageCollectionTests.collect   s     		"r$   c                   V ^8  d   QhRR/# )r   r   r   r    )r!   s   "r"   r#   rg      s      G r$   c                d    \         P                  ! V P                  4      p\        4       Vn        V# )z>
Return a L{TrialRunner} object that is safe to use in tests.
)r   r9   r5   r   r:   rL   r>   s   & r"   
makeRunner&ForceGarbageCollectionTests.makeRunner   s&     ""4;;/ 
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rg      s     
 
d 
r$   c                    RV P                   R&   V P                   P                  4        V P                  4       pVP                  V P                  4       V P                  V P                  . RO4       R# )zs
Passing the --force-gc option to the trial script forces the garbage
collector to run before and after each test.
Tzforce-gcN)ri   rn   ri   ri   rn   ri   r5   postOptionsr}   r=   rn   assertEqualrj   r|   s   & r"   test_forceGc(ForceGarbageCollectionTests.test_forceGc   sV    
 #'J!"

499HHR	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rg      s     5 5 5r$   c                    V P                   P                  4        V P                  4       pVP                  V P                  4       V P                  V P                  RR.4       R# )z.
By default, no garbage collection is forced.
rn   Nr   r|   s   & r"   test_unforceGc*ForceGarbageCollectionTests.test_unforceGc   sI     	!"

499FF#34r$   )r5   rj   rn   N)r^   r_   r`   ra   rb   ro   rm   ri   r}   r   r   rc   r    r$   r"   re   re      s*    , #
5 5r$   re   c                  >    ] tR t^tRtR R ltR R ltR R ltRtR	# )
SuiteUsedTestsz7
Check the category of tests suite used by the loader.
c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   SuiteUsedTests.__annotate__   s     & &t &r$   c                :    \         P                  ! 4       V n        R# )z&
Create a trial configuration object.
Nr   r3   r5   ru   s   &r"   ro   SuiteUsedTests.setUp   s     mmor$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r      s     D D4 Dr$   c                    \         P                  ! V P                  4      pV P                  VP                  \
        4       R# )z;
By default, the loader should use L{DestructiveTestSuite}
N)r   
_getLoaderr5   r   suiteFactoryr   rL   loaders   & r"   test_defaultSuite SuiteUsedTests.test_defaultSuite   s/     !!$++.,,.BCr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r      s     9 9 9r$   c                    RV P                   R&   \        P                  ! V P                   4      pV P                  VP                  \
        4       R# )z_
The C{until-failure} configuration uses the L{TestSuite} to keep
instances alive across runs.
Tzuntil-failureN)r5   r   r   r   r   r   r   s   & r"   test_untilFailureSuite%SuiteUsedTests.test_untilFailureSuite   s<    
 (,O$!!$++.,,i8r$   r5   N)	r^   r_   r`   ra   rb   ro   r   r   rc   r    r$   r"   r   r      s    &D9 9r$   r   c                  N   ] tR t^tR R ltR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R  ltR! R" ltR# R$ ltR% R& ltR' R( ltR) R* ltR+ R, ltR- R. ltR/ R0 ltR1 R2 ltR3 R4 ltR5tR6# )7TestModuleTestsc                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   TestModuleTests.__annotate__        & &t &r$   c                	:    \         P                  ! 4       V n        R # Nr   ru   s   &r"   ro   TestModuleTests.setUp       mmor$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r      s      $ r$   c                	    R V n         R # r   r   ru   s   &r"   tearDownTestModuleTests.tearDown   s	    r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r      s     7 7 7r$   c                Z    V P                  \        V 4      V P                  4       .4       R# )zY
Check that the testNames helper method accurately collects the
names of tests in suite.
N)r   r   idru   s   &r"   test_testNamesTestModuleTests.test_testNames   s     
 	44779+6r$   c               $    V ^8  d   QhRRRRRR/# )r   test1r   namesz	list[str]r   r*   r    )r!   s   "r"   r#   r      s!     ) )y ) )t )r$   c                	    \        4       p\        V4      p\        \        \        VP                  V4      4      4      pVP                  4        VP                  4        V P                  WE4       R # r   )r   r   r   map
loadByNamesortr   )rL   r   r   r   names1names2s   &&&   r"   assertSuitesEqual!TestModuleTests.assertSuitesEqual   sO    5!9S):):E%BCD(r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r      s     7 7 7r$   c                	^    V P                  ^ \        V P                  R,          4      4       R# )r   testsN)r   lenr5   ru   s   &r"   test_baseStateTestModuleTests.test_baseState   s     CG 456r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r      s     
 
 
r$   c                    V P                   P                  \        R4      4       V P                  \        P
                  ! V P                   4      R.4       R# )zt
Check that --testmodule loads a suite which contains the tests
referred to in test-case-name inside its parameter.
moduletest.pytwisted.trial.test.test_logNr5   opt_testmoduler&   r   r   	_getSuiteru   s   &r"   test_testmoduleOnModule'TestModuleTests.test_testmoduleOnModule   s?    
 	""7?#;<OODKK(+H*I	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r          	
 	
d 	
r$   c                    V P                   P                  \        R4      4       V P                   P                  \        R4      4       V P                  \        P
                  ! V P                   4      R.4       R# )zi
When the same module is specified with two --testmodule flags, it
should only appear once in the suite.
r   r   Nr   ru   s   &r"   test_testmoduleTwice$TestModuleTests.test_testmoduleTwice  sV    
 	""7?#;<""7?#;<OODKK(+H*I	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r     s     

 

$ 

r$   c                    V P                   P                  \        R4      4       V P                   P                  \        R4      4       V P                  \        P
                  ! V P                   4      R.4       R# )z
If --testmodule is specified twice, once for module A and once for
a module which refers to module A, then make sure module A is only
added once.
r   ztest_log.pyr   Nr   ru   s   &r"    test_testmoduleOnSourceAndTarget0TestModuleTests.test_testmoduleOnSourceAndTarget  sV     	""7?#;<""7=#9:OODKK(+H*I	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r     s     
 
T 
r$   c                    V P                   P                  \        R4      4       V P                  \        P
                  ! V P                   4      R.4       R# )z
When given a module that refers to *itself* in the test-case-name
variable, check that --testmodule only adds the tests once.
zmoduleself.pyztwisted.trial.test.moduleselfNr   ru   s   &r"   test_testmoduleOnSelfModule+TestModuleTests.test_testmoduleOnSelfModule  s?    
 	""7?#;<OODKK(+J*K	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   $  s     	
 	
 	
r$   c                    V P                   P                  \        R4      4       V P                  \        P
                  ! V P                   4      RR.4       R# )zU
Check that --testmodule loads tests referred to in test-case-name
buffer variables.
scripttest.pyr   twisted.trial.test.test_runnerNr   ru   s   &r"   test_testmoduleOnScript'TestModuleTests.test_testmoduleOnScript$  sB    
 	""7?#;<OODKK(*,LM	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   /  s        $  r$   c                f   \        4       p\        P                  Vup\        n        Rp V P                  P	                  V4       V P                  ^ \        V P                  R,          4      4       V P                  RV: R2VP                  4       4       V\        n        R#   T\        n        i ; i)zb
Check that --testmodule displays a meaningful error message when
passed a non-existent filename.
ztest_thisbetternoteverexist.pyr   File  doesn't exist
Nr   sysstderrr5   r   r   r   getvalue)rL   buffyr   r   s   &   r"    test_testmoduleOnNonexistentFile0TestModuleTests.test_testmoduleOnNonexistentFile/  s    
 
 ZZ
3	 KK&&x0QDKK$8 9:uXL0@A5>>CSTCJCJ   A,B# #B0c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   >  s     7 7D 7r$   c                    V P                   P                  \        R4      4       V P                  ^ \	        V P                   R,          4      4       R# )zl
Check that --testmodule adds no tests to the suite for modules
which lack test-case-name buffer variables.
	novars.pyr   N)r5   r   r&   r   r   ru   s   &r"   test_testmoduleOnEmptyVars*TestModuleTests.test_testmoduleOnEmptyVars>  s9    
 	""7;#78CG 456r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   F  s        T  r$   c                f   \        4       p\        P                  Vup\        n        Rp V P                  P	                  V4       V P                  ^ \        V P                  R,          4      4       V P                  RV: R2VP                  4       4       V\        n        R#   T\        n        i ; i)zw
Check that --testmodule does *not* support module names as arguments
and that it displays a meaningful error message.
ztwisted.trial.test.test_scriptr   r   r   Nr   )rL   r   r   
moduleNames   &   r"   test_testmoduleOnModuleName+TestModuleTests.test_testmoduleOnModuleNameF  s    
 
 ZZ
5
	 KK&&z2QDKK$8 9:uZN2BCU^^EUVCJCJr   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   U  s     Y Y Yr$   c                	^    R p\         P                  ! V4      pV P                  RR/V4       R# )z5-*- test-case-name: twisted.trial.test.test_tests -*-test-case-nametwisted.trial.test.test_testsNr   _parseLocalVariablesr   rL   declaration	localVarss   &  r"   test_parseLocalVariable'TestModuleTests.test_parseLocalVariableU  s.    M..{;	*,KLiXr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   Z  s     Y Y Yr$   c                	^    R p\         P                  ! V4      pV P                  RR/V4       R# )z6-*- test-case-name: twisted.trial.test.test_tests; -*-r   r   Nr   r   s   &  r"   test_trailingSemicolon&TestModuleTests.test_trailingSemicolonZ  s.    N..{;	*,KLiXr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   _  s     
 
$ 
r$   c                	b    R p\         P                  ! V4      pV P                  RRRR/V4       R# )z?-*- test-case-name: twisted.trial.test.test_tests; foo: bar -*-r   r   foobarNr   r   s   &  r"   test_parseLocalVariables(TestModuleTests.test_parseLocalVariables_  s9    P 	 ..{;	>uMy	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   h  s     Y Yd Yr$   c                	^    R p\         P                  ! V4      pV P                  RR/V4       R# )z:## -*- test-case-name: twisted.trial.test.test_tests -*- #r   r   Nr   r   s   &  r"   test_surroundingGuff$TestModuleTests.test_surroundingGuffh  s.    U..{;	*,KLiXr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   m  s     I I$ Ir$   c                	P    V P                  \        \        P                  R 4       R# )r  NassertRaises
ValueErrorr   r   ru   s   &r"   test_invalidLine TestModuleTests.test_invalidLinem  s    *e&@&@%Hr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   p  s     
 
 
r$   c                	    V P                  \        \        P                  R 4       V P                  \        \        P                  R4       V P                  \        \        P                  R4       R# )z-*- foo -*-z-*- foo: bar; qux -*-z-*- foo: bar: baz; qux: qax -*-Nr  ru   s   &r"   test_invalidDeclaration'TestModuleTests.test_invalidDeclarationp  sT    *e&@&@-P224K	
 	224U	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   y  s     W W Wr$   c                	l    \         P                  ! \        R 4      4      pV P                  RR/V4       R# )r   r   r   Nr   loadLocalVariablesr&   r   rL   r   s   & r"   test_variablesFromFile&TestModuleTests.test_variablesFromFiley  s.    ,,W_-EF	*,IJIVr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r   }  s     ( ( (r$   c                	h    \         P                  ! \        R 4      4      pV P                  / V4       R# r   Nr  r  s   & r"   test_noVariablesInFile&TestModuleTests.test_noVariablesInFile}  s'    ,,W[-AB	Y'r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r     s     	
 	
$ 	
r$   c                	l    \         P                  ! \        R 4      4      pV P                  RR/V4       R# )r   r   z:twisted.trial.test.test_log,twisted.trial.test.test_runnerNr  r  s   & r"   test_variablesFromScript(TestModuleTests.test_variablesFromScript  s5    ,,W_-EF	 S
 	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r     s     C CT Cr$   c                	j    \         P                  ! \        R 4      4      pV P                  VR.4       R# )r   r   N)r   getTestModulesr&   r   rL   moduless   & r"   test_getTestModules#TestModuleTests.test_getTestModules  s+    &&w'?@#@"ABr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r     s     * *D *r$   c                	z    \         P                  ! \        R 4      4      pV P                  \	        V4      ^ 4       R# r   )r   r)  r&   r   r   r*  s   & r"   test_getTestModules_noVars*TestModuleTests.test_getTestModules_noVars  s+    &&w{';<Wq)r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r     s     
 
d 
r$   c                	~    \         P                  ! \        R 4      4      pV P                  \	        V4      RR04       R# )r   r   r   N)r   r)  r&   r   setr*  s   & r"   test_getTestModules_multiple,TestModuleTests.test_getTestModules_multiple  s5    &&w'?@L*,LM	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r     s      $ r$   c                	    R F-  pV P                  \        P                  ! V4      V: R24       K/  	  R\        R4      \        R4      3 F-  pV P	                  \        P                  ! V4      V: R24       K/  	  R# )test_script.pyz should be a test filez twisted/trial/test/moduletest.pyr   ztest_foo.batz should *not* be a test fileN)r9  z!twisted/trial/test/test_script.py)
assertTruer   
isTestFiler&   assertFalse)rL   r   s   & r"   test_looksLikeTestModule(TestModuleTests.test_looksLikeTestModule  s|    OHOO  *,45 P /O$N#
H
   *,:;
r$   r   N)r^   r_   r`   ra   ro   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  r  r  r  r!  r%  r,  r0  r5  r=  rc   r    r$   r"   r   r      s    &7)7
	



	
 7 Y
Y

Y
I
W(	
C*
 r$   r   c                  n    ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltRtR# )WithoutModuleTestsi  z"
Test the C{without-module} flag.
c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   WithoutModuleTests.__annotate__  s     . .t .r$   c                v    \         P                  ! 4       V n        \        \        P
                  4      V n        R# )zT
Create a L{trial.Options} object to be used in the tests, and save
C{sys.modules}.
N)r   r3   r5   dictr   r+  savedModulesru   s   &r"   ro   WithoutModuleTests.setUp  s"    
 mmo -r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB    s     . .$ .r$   c                    R FY  pWP                   9   d'   V P                   V,          \        P                  V&   K9  \        P                  P                  VR4       K[  	  R# )z
Restore C{sys.modules}.
N)imaplibsmtplib)rE  r   r+  pop)rL   modules   & r"   r   WithoutModuleTests.tearDown  sE     -F***&*&7&7&?F#-	 -r$   c                   V ^8  d   QhRR/# r   r   objectr    )r!   s   "r"   r#   rB          F r$   c                    ^ RI pV# )z5
Try to import the C{smtplib} module, and return it.
N)rJ  )rL   rJ  s   & r"   
_checkSMTPWithoutModuleTests._checkSMTP       	r$   c                   V ^8  d   QhRR/# rO  r    )r!   s   "r"   r#   rB    rQ  r$   c                    ^ RI pV# )z5
Try to import the C{imaplib} module, and return it.
N)rI  )rL   rI  s   & r"   
_checkIMAPWithoutModuleTests._checkIMAP  rU  r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB    s     	C 	Ct 	Cr$   c                    V P                   P                  RR.4       V P                  \        V P                  4       \
        P                  R V P                  V P	                  4       \        P                  4       R# )zD
Check that after disabling a module, it can't be imported anymore.
--without-modulerJ  N)
r5   r4   r  ImportErrorrS  r   r+  assertIsInstancetypes
ModuleTyperu   s   &r"   test_disableOneModule(WithoutModuleTests.test_disableOneModule  sY     	  "4i!@A+t7KK	"doo/1A1ABr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB    s     C CT Cr$   c                   V P                   P                  RR.4       V P                  \        V P                  4       V P                  \        V P
                  4       \        P                  R \        P                  R V P                  V P	                  4       \        P                  4       V P                  V P                  4       \        P                  4       R# )z5
Check that several modules can be disabled at once.
r\  zsmtplib,imaplibrJ  rI  N)r5   r4   r  r]  rS  rX  r   r+  r^  r_  r`  ru   s   &r"   test_disableMultipleModules.WithoutModuleTests.test_disableMultipleModules  s     	  "46G!HI+t7+t7KK	"KK	"doo/1A1ABdoo/1A1ABr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB    s     8 84 8r$   c                   V P                  V P                  4       \        P                  4       V P	                  \
        R\        P                  V P                  P                  RR.4       V P                  \        V P                  4       R# )z@
Disabling an already imported module should produce a warning.
z4Module 'smtplib' already imported, disabling anyway.r\  rJ  N)r^  rS  r_  r`  assertWarnsRuntimeWarningr   r'   r5   r4   r  r]  ru   s   &r"   !test_disableAlreadyImportedModule4WithoutModuleTests.test_disableAlreadyImportedModule  sg     	doo/1A1ABBNNKK$$+	
 	+t7r$   )r5   rE  N)r^   r_   r`   ra   rb   ro   r   rS  rX  ra  re  rk  rc   r    r$   r"   r@  r@    s1    ..	CC8 8r$   r@  c                      ] tR tRtRt]P                  R,          R8  t]! ]	RR4      RJt
]! ]'       * R4      R R l4       t]! ];'       g    ]
'       * R	4      R
 R l4       tR R ltR R ltRtR# )AutoJobsTestsi  z(
Test {twisted.scripts.trial._autoJobs}
:Nr   Nsched_getaffinityNzRequires os.process_cpu_count()c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   AutoJobsTests.__annotate__  s     3 3d 3r$   c                z    \         P                  ! 4       pV P                  \        P                  ! 4       V4       R# )z\
When `os.process_cpu_count()` is available (Python 3.13+), `_autoJobs`
returns its result.
N)osprocess_cpu_countr   r   	_autoJobs)rL   counts   & r"   test_processCpuCount"AutoJobsTests.test_processCpuCount  s)     $$&*E2r$   z>Requires os.sched_getaffinity() without os.process_cpu_count()c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rq    s     J Jt Jr$   c                    V P                  \        P                  ! 4       \        \        P
                  ! ^ 4      4      4       R# )z
When `os.sched_getaffinity()` is available but `os.process_cpu_count()`
is not (Python 3.3 through Python 3.12 on "some Unix platforms"),
`_autoJobs` uses it to returns the number of CPUs that the current
process is restricted to.
N)r   r   ru  r   rs  ro  ru   s   &r"   test_schedGetAffinity#AutoJobsTests.test_schedGetAffinity  s+     	*C0D0DQ0G,HIr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rq    s     < <t <r$   c                v    V P                  \        P                  ! 4       \        P                  ! 4       4       R# )zJ
When only `os.cpu_count()` is available, `_autoJobs` returns
its result.
N)r   r   ru  rs  	cpu_countru   s   &r"   test_cpuCountAutoJobsTests.test_cpuCount  s!    
 	*BLLN;r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rq     s     / /d /r$   c                (   V P                   '       d   V P                  \        RR 4       V P                  '       d   V P                  \        RR 4       V P                  \        RR 4       V P	                  \
        P                  ! 4       ^4       R# )z
When `os.cpu_count()` returns L{None}, `_autoJobs`
rounds up to 1.

This test relies on patching because all platforms currently
supported by Twisted provide a functioning `os.cpu_count()`.
rt  c                     R # r   r    r    r$   r"   <lambda>4AutoJobsTests.test_cpuCountUnknown.<locals>.<lambda>)  s    r$   ro  c                    \        4       # r   )r4  )pids   &r"   r  r  +  s    CEr$   r  c                     R # r   r    r    r$   r"   r  r  ,  s    Dr$   N)hasProcessCpuCountrk   rs  hasSchedGetaffinityr   r   ru  ru   s   &r"   test_cpuCountUnknown"AutoJobsTests.test_cpuCountUnknown   sf     """JJr.=###JJr.0AB

2{L1*A.r$   r    )      )r^   r_   r`   ra   rb   r   version_infor  getattrrs  r  r   rw  r{  r  r  rc   r    r$   r"   rn  rn    s     ))"-8!"&94@L""$EF3 G3 55"55HJ	J</ /r$   rn  c                  f    ] tR tRtRt]! ]RR4      f   RtR R ltR R	 lt	R
 R lt
R R ltRtR# )CoverageTestsi1  z#
Tests for the I{coverage} option.
gettraceNz;Cannot test trace hook installation without inspection API.c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   CoverageTests.__annotate__9  s     6 6t 6r$   c                l    V P                  \        P                  \        P                  ! 4       4       R# )zN
Arrange for the current trace hook to be restored when the
test is complete.
N)
addCleanupr   settracer  ru   s   &r"   ro   CoverageTests.setUp9  s    
 	clln5r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r  @  s     
 
d 
r$   c                    \         P                  ! 4       pVP                  R.4       VP                  f   Q hV P	                  \
        P                  ! 4       VP                  P                  4       R# )ze
L{trial.Options} handles C{"--coverage"} by installing a trace
hook to record coverage information.
z
--coverageN)r   r3   r4   tracerr   r   r  globaltracerL   optionss   & r"   test_tracerInstalled"CoverageTests.test_tracerInstalled@  sS    
 --/l^,~~)))LLNNN&&	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r  N  r   r$   c                    \         P                  ! 4       pV P                  VP                  4       \	        R4      P                  VR,          R.4      4       R# )z
L{trial.Options.coverdir} returns a L{FilePath} based on the default
for the I{temp-directory} option if that option is not specified.
rY   rT   coverageN)r   r3   r   coverdirr   
descendantr  s   & r"   test_coverdirDefault"CoverageTests.test_coverdirDefaultN  sF    
 --/SM$$g.>&?%LM	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r  Y  s     O O Or$   c                    V P                  4       p\        P                  ! 4       pVP                  RV.4       V P	                  VP                  4       \        V4      P                  R4      4       R# )zs
If a value is specified for the I{temp-directory} option,
L{trial.Options.coverdir} returns a child of that path.
rG   r  N)mktempr   r3   r4   r   r  r   child)rL   rZ   r  s   &  r"   test_coverdirOverridden%CoverageTests.test_coverdirOverriddenY  sV    
 {{}--/0$78))+Xd^-A-A*-MNr$   r    )r^   r_   r`   ra   rb   r  r   skipro   r  r  r  rc   r    r$   r"   r  r  1  s8     sJ%-L6
	
O Or$   r  c                  b    ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
RtR# )OptionsTestsid  z
Tests for L{trial.Options}.
c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   OptionsTests.__annotate__i  s     ' 't 'r$   c                :    \         P                  ! 4       V n        R# )z5
Build an L{Options} object to be used in the tests.
Nr   r3   r  ru   s   &r"   ro   OptionsTests.setUpi  s     }}r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r  o  s     = = =r$   c                   V P                  \        P                  \        P                  ! 4       4       \        P
                  ! 4       '       d    V P                  \        P                  4       V P                  P                  . RO4       V P                  P                  4       pV P                  RV4       VP                  R4       V P                  RR.V4       R# )z
C{_getWorkerArguments} discards options like C{random} as they only
matter in the manager, and forwards options like C{recursionlimit} or
C{disablegc}.
--recursionlimit2000--disablegcN)r  r  --random4r  )r  r   setrecursionlimitgetrecursionlimitrl   	isenabledenabler  r4   _getWorkerArgumentsassertInremover   )rL   argss   & r"   test_getWorkerArguments$OptionsTests.test_getWorkerArgumentso  s     	--s/D/D/FG<<>>OOBII&!!H	
 ||//1mT*M",f5t<r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r    s     
T 
TD 
Tr$   c                    V P                  \        V P                  P                  . RO4      pV P	                  R\        V4      4       R# )z
C{parseOptions} raises a C{UsageError} when C{--debug} is passed along
C{--jobs} as it's not supported yet.

@see: U{http://twistedmatrix.com/trac/ticket/5825}
z+You can't specify --debug when using --jobsN)--jobsr  --debugr  r   r  r4   r   r   rL   errors   & r"   test_jobsConflictWithDebug'OptionsTests.test_jobsConflictWithDebug  s=     !!113M
 	FE
Sr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r         
V 
Vd 
Vr$   c                    V P                  \        V P                  P                  . RO4      pV P	                  R\        V4      4       R# )z
C{parseOptions} raises a C{UsageError} when C{--profile} is passed
along C{--jobs} as it's not supported yet.

@see: U{http://twistedmatrix.com/trac/ticket/5827}
z-You can't specify --profile when using --jobsN)r  r  z	--profiler  r  s   & r"   test_jobsConflictWithProfile)OptionsTests.test_jobsConflictWithProfile  s=     !!113O
 	H#e*Ur$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r    s     
 
t 
r$   c                    V P                  \        V P                  P                  . RO4      pV P	                  R\        V4      4       R# )z
C{parseOptions} raises a C{UsageError} when C{--debug-stacktraces} is
passed along C{--jobs} as it's not supported yet.

@see: U{http://twistedmatrix.com/trac/ticket/5826}
z7You can't specify --debug-stacktraces when using --jobsN)r  r  z--debug-stacktracesr  r  s   & r"   %test_jobsConflictWithDebugStackTraces2OptionsTests.test_jobsConflictWithDebugStackTraces  s@     !!LL%%2

 	Es5z	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r    r  r$   c                    V P                  \        V P                  P                  . RO4      pV P	                  R\        V4      4       R# )zZ
C{parseOptions} raises a C{UsageError} when C{--order} is passed along
with C{--random}.
z-You can't specify --random when using --orderN)--orderalphabeticalr  1234r  r  s   & r"   test_orderConflictWithRandom)OptionsTests.test_orderConflictWithRandom  s>    
 !!LL%%;

 	H#e*Ur$   r  N)r^   r_   r`   ra   rb   ro   r  r  r  r  r  rc   r    r$   r"   r  r  d  s.    '=$
T
V
 
V 
Vr$   r  c                  z    ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltRtR# )MakeRunnerTestsi  z&
Tests for the L{_makeRunner} helper.
c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   MakeRunnerTests.__annotate__  s     ' 't 'r$   c                	:    \         P                  ! 4       V n        R # r   r  ru   s   &r"   ro   MakeRunnerTests.setUp  s    }}r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r    s     B B4 Br$   c                N   V P                   P                  . RO4       \        P                  ! V P                   4      p\	        V\
        4      '       g   Q hV P                  V\
        4       V P                  ^VP                  4       V P                  R.VP                  4       R# )z
L{_makeRunner} returns a L{DistTrialRunner} instance when the C{--jobs}
option is passed.  The L{DistTrialRunner} knows how many workers to
run and the C{workerArguments} to pass to them.

--force-gcN)r  r  r  )
r  r4   r   r9   
isinstancer   r^  r   _maxWorkers_workerArgumentsr|   s   & r"   	test_jobsMakeRunnerTests.test_jobs  s|     	!!"?@""4<<0&/2222fo6F../,)@)@Ar$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r    s     T TT Tr$   c                    V P                  \        V P                  P                  RR.4      pV P	                  R\        V4      4       R# )zP
C{parseOptions} raises a C{UsageError} when C{--jobs} is passed a non-integer.
r  nanz-Expecting integer argument to jobs, got 'nan'Nr  rL   excs   & r"   test_jobsNotANumber#MakeRunnerTests.test_jobsNotANumber  sA     11He3D
 	H#c(Sr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r    s     
 
d 
r$   c                    V P                  \        V P                  P                  RR.4      pV P	                  R\        V4      4       R# )zY
C{parseOptions} raises a C{UsageError} when C{--jobs} is passed a non-positive
integer.
r  0z>Argument to jobs must be a strictly positive integer or 'auto'Nr  r  s   & r"   test_jobsNonPositive$MakeRunnerTests.test_jobsNonPositive  s?    
 
DLL,E,ERUWLcRUh	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r    s     1 1T 1r$   c                   V P                  \        RR 4       \        P                  ! 4       pVP                  RR.4       \        P                  ! V4      p\        V\        4      '       g   Q hV P                  ^MVP                  4       R# )z6
C{--jobs auto} guesses the number of workers to use.
ru  c                     ^M# )M   r    r    r$   r"   r  EMakeRunnerTests.test_autoDetectAvailableCpusForJobs.<locals>.<lambda>  s    rr$   r  autoN)	rk   r   r3   r4   r9   r  r   r   r  )rL   r  r>   s   &  r"   #test_autoDetectAvailableCpusForJobs3MakeRunnerTests.test_autoDetectAvailableCpusForJobs  sk     	

5+z2--/h/0""7+&/2222V//0r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r    s     	; 	;T 	;r$   c                0   V P                   P                  . RO4       \        P                  ! V P                   4      p\	        V\
        4      '       g   Q hV P                  V\
        4       V P                  \
        P                  VP                  4       R# )z
L{_makeRunner} returns a L{TrialRunner} instance in C{DRY_RUN} mode
when the C{--dry-run} option is passed, even if C{--jobs} is set.
N)r  r  z	--dry-run)
r  r4   r   r9   r  r   r^  r   DRY_RUNmoder|   s   & r"   test_dryRunWithJobs#MakeRunnerTests.test_dryRunWithJobs  sh    
 	!!">?""4<<0&+....fk2,,fkk:r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r    s     O Ot Or$   c                	>  a \         P                  P                  oR  V3R llpV P                  \         P                  RV4       \         P                  ! 4       pVP                  . RO4       V P                  \         P                  \         P                  V4       R# )c                    V ^8  d   QhRRRR/# )r   fqnr   r   rP  r    )r!   s   "r"   r#   ;MakeRunnerTests.test_DebuggerNotFound.<locals>.__annotate__  s     	! 	! 	! 	!r$   c                `   < V R 8X  d    \         P                  P                  V 4      hS! V 4      # )	doNotFind)r   reflectModuleNotFound)r  namedAnys   &r"   namedAnyExceptdoNotFindFMakeRunnerTests.test_DebuggerNotFound.<locals>.namedAnyExceptdoNotFind  s*    k!mm22377C= r$   r  N)r  z
--debuggerr  )	r   r  r  rk   r3   r4   r  _DebuggerNotFoundr9   )rL   r  r  r  s   &  @r"   test_DebuggerNotFound%MakeRunnerTests.test_DebuggerNotFound  sk    ==))	! 	!
 	

5==*.EF--/CD%1153D3DgNr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r    s     + + +r$   c                    V P                   P                  R.4       \        P                  ! V P                   4      p\	        V\
        4      '       g   Q hV P                  VP                  4       R# )zj
Passing C{--exitfirst} wraps the reporter with a
L{reporter._ExitWrapper} that stops on any non-success.
z--exitfirstN)r  r4   r   r9   r  r   r:  
_exitFirstr|   s   & r"   test_exitfirstMakeRunnerTests.test_exitfirst  sQ    
 	!!=/2""4<<0&+....))*r$   r  N)r^   r_   r`   ra   rb   ro   r  r  r  r  r	  r  r  rc   r    r$   r"   r  r    s7    'BT
1	;O+ +r$   r  c                  2    ] tR tRtRtR R ltR R ltRtR# )	RunTestsi  z 
Tests for the L{run} function.
c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   RunTests.__annotate__  s     E Et Er$   c                	J    V P                  \        P                  R R 4       R# )r4   c                    R # r   r    ru   s   &r"   r   RunTests.setUp.<locals>.<lambda>  s    tr$   N)rk   r   r3   ru   s   &r"   ro   RunTests.setUp  s     	

5==.2CDr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r"    s     J Jt Jr$   c                    R R lpV P                  \        RV4        \        P                  ! 4        V P                  R4       R#   \         d'   pT P                  R\        T4      4        Rp?R# Rp?ii ; i)zI
When a debugger is not found, an error message is printed to the user.

c               $    V ^8  d   QhRRRRRR/# )r   r  rP  kwargsr   r*   r    )r!   s   "r"   r#   4RunTests.test_debuggerNotFound.<locals>.__annotate__   s!     	1 	1v 	1 	1D 	1r$   c                 .    \         P                  ! R 4      h)r  )r   r  )r  r*  s   *,r"   r9   3RunTests.test_debuggerNotFound.<locals>._makeRunner   s    ))%00r$   r9   z0Should have exited due to non-existent debugger!r  N)rk   r   r=   fail
SystemExitr  r   )rL   r9   es   &  r"   test_debuggerNotFoundRunTests.test_debuggerNotFound  s^    	1 	

5-5	JIIK IIHI  	)MM%Q((	)s   A A8A33A8r    N)r^   r_   r`   ra   rb   ro   r1  rc   r    r$   r"   r   r     s    E
J Jr$   r   c                  2    ] tR tRtRtR R ltR R ltRtR# )	TestArgumentOrderTestsi-  zI
Tests for the order-preserving behavior on provided command-line tests.
c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   #TestArgumentOrderTests.__annotate__2  s     # #t #r$   c                	X    \         P                  ! 4       V n        \        4       V n        R # r   )r   r3   r5   r   r   ru   s   &r"   ro   TestArgumentOrderTests.setUp2  s    mmo lr$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   r6  6  s     / /D /r$   c                $   . ROpV P                   P                  V4       \        P                  ! V P                   4      p\	        V4      p\        \        V P                  P                  V4      4      p\	        V4      pV P                  W54       R# )z>
Multiple tests passed on the command line are not reordered.
N)r   z"twisted.trial.test.test_assertionsz twisted.trial.test.test_deferred)
r5   r4   r   r   r   r   r   r   r   r   )rL   r   r?   r   expectedSuiteexpectedNamess   &     r"   test_preserveArgumentOrder1TestArgumentOrderTests.test_preserveArgumentOrder6  sl    

 	  ',% !#dkk&<&<e"DE!-0.r$   )r5   r   N)r^   r_   r`   ra   rb   ro   r=  rc   r    r$   r"   r4  r4  -  s    #/ /r$   r4  c                      ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltR R ltRtR# )
OrderTestsiJ  z
Tests for the --order option.
c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   OrderTests.__annotate__O  r   r$   c                	:    \         P                  ! 4       V n        R # r   r   ru   s   &r"   ro   OrderTests.setUpO  r   r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB  R  s     
 
4 
r$   c                    V P                   P                  . RO4       \        P                  ! V P                   4      pVP	                  V P                   R,          4      pV P                  \        V4      . RO4       R# )zV
--order=alphabetical causes trial to run tests alphabetically within
each test case.
r   N)r  r  %twisted.trial.test.ordertests.FooTest)0twisted.trial.test.ordertests.FooTest.test_first1twisted.trial.test.ordertests.FooTest.test_fourth1twisted.trial.test.ordertests.FooTest.test_second0twisted.trial.test.ordertests.FooTest.test_thirdr5   r4   r   r   loadByNamesr   r   rL   r   r?   s   &  r"   test_alphabeticalOrderTests.test_alphabeticalR  sc    
 	  P	
 !!$++.""4;;w#78e	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB  h  s     
 
 
r$   c                    V P                   P                  . RO4       \        P                  ! V P                   4      pVP	                  V P                   R,          4      pV P                  \        V4      . RO4       R# )z]
--order=alphabetical causes trial to run test classes within a given
module alphabetically.
r   N)r  r  twisted.trial.test.ordertests).twisted.trial.test.ordertests.BarTest.test_bar.twisted.trial.test.ordertests.BazTest.test_bazrH  rI  rJ  rK  rL  rN  s   &  r"   test_alphabeticalModule"OrderTests.test_alphabeticalModuleh  sc    
 	  H	
 !!$++.""4;;w#78e
	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB    s     / /$ /r$   c                6   V P                   P                  . RO4       \        P                  ! V P                   4      pVP	                  V P                   R,          4      p\        V4      pV P                  VRR7       V P                  V\        V4      4       R# )z
--order=alphabetical causes trial to run test modules within a given
package alphabetically, with tests within each module alphabetized.
r   zFailed to load any tests!msgN)r  r  twisted.trial.test)	r5   r4   r   r   rM  r   r:  r   sortedrL   r   r?   r   s   &   r"   test_alphabeticalPackage#OrderTests.test_alphabeticalPackage  ss    
 	  !RS!!$++.""4;;w#78% #>?u.r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB    s     
 
$ 
r$   c                    V P                   P                  . RO4       \        P                  ! V P                   4      pVP	                  V P                   R,          4      pV P                  \        V4      . RO4       R# )z
--order=toptobottom causes trial to run test methods within a given
test case from top to bottom as they are defined in the body of the
class.
r   N)r  toptobottomrG  )rH  rJ  rK  rI  rL  rN  s   &  r"   test_toptobottomOrderTests.test_toptobottom  sc     	  O	
 !!$++.""4;;w#78e	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB    s     
 
 
r$   c                    V P                   P                  . RO4       \        P                  ! V P                   4      pVP	                  V P                   R,          4      pV P                  \        V4      . RO4       R# )z
--order=toptobottom causes trial to run test classes within a given
module from top to bottom as they are defined in the module's source.
r   Nr  rc  rS  )rH  rJ  rK  rI  rU  rT  rL  rN  s   &  r"   test_toptobottomModule!OrderTests.test_toptobottomModule  sc    
 	  G	
 !!$++.""4;;w#78e
	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB    s     
 
 
r$   c                   V P                   P                  . RO4       \        P                  ! V P                   4      pVP	                  V P                   R,          4      p\        V4      pV P                  V\        VR R7      4       R# )z
--order=toptobottom causes trial to run test modules within a given
package alphabetically, with tests within each module run top to
bottom.
r   c                2    V P                  R 4      R,          # )rY   :N   N)split)names   &r"   r  4OrderTests.test_toptobottomPackage.<locals>.<lambda>  s    4::c?2+>r$   )keyN)r  rc  r\  )r5   r4   r   r   rM  r   r   r]  r^  s   &   r"   test_toptobottomPackage"OrderTests.test_toptobottomPackage  sl     	  !QR!!$++.""4;;w#78%  	5>?	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB    s     .
 .
t .
r$   c                   V P                  4       p\        V4      P                  R4      pVP                  4        VP                  R4      P	                  R4       VP                  R4      P	                  \
        P                  ! R4      P                  R4      4       VP                  4       P                  p\        P                  P                  ^ V4       V P                  \        P                  P                  V4       ^ RIHp V P                  \        P                   P"                  R4       V P                  \        P                   P"                  VP$                  4       VP                  R4      P                  4        V P&                  P)                  . R	O4       \*        P,                  ! V P&                  4      pVP/                  V4      pV P1                  \3        V4      . R
O4       R# )zc
--order=toptobottom detects the source line of methods from modules
whose source file is missing.
twisted_toptobottom_tempz__init__.pyr$   ztest_missing.pya   
        from twisted.trial.unittest import TestCase
        class TestMissing(TestCase):
            def test_second(self) -> None: pass
            def test_third(self) -> None: pass
            def test_fourth(self) -> None: pass
            def test_first(self) -> None: pass
        utf8)test_missingNrh  )z=twisted_toptobottom_temp.test_missing.TestMissing.test_secondz<twisted_toptobottom_temp.test_missing.TestMissing.test_thirdz=twisted_toptobottom_temp.test_missing.TestMissing.test_fourthz<twisted_toptobottom_temp.test_missing.TestMissing.test_first)r  r   r  makedirs
setContenttextwrapdedentencodeparentrZ   r   insertr  r  rw  ry  r+  rK  r^   r5   r4   r   r   
loadModuler   r   )rL   tempdirpackage	pathEntryry  r   r?   s   &      r"   test_toptobottomMissingSource(OrderTests.test_toptobottomMissingSource  s^   
 ++-7#))*DEm$//4'(33OO	 fVn	
 NN$))	9%3	
 	)CD)>)>?'(//1  G	
 !!$++.!!,/e	
r$   c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   rB    s     
 
4 
r$   c                `    V P                  \        V P                  P                  RR.4       R# )z<
An unknown order passed to --order raises a L{UsageError}.
r  zI don't existN)r  r   r5   r4   ru   s   &r"   test_unknownOrderOrderTests.test_unknownOrder  s(    
 	009o2N	
r$   r   N)r^   r_   r`   ra   rb   ro   rO  rV  r_  rd  ri  rs  r  r  rc   r    r$   r"   r@  r@  J  s:    &
,
./
.
.
$.
`
 
r$   r@  c                  &    ] tR tRtRtR R ltRtR# )HelpOrderTestsi  z#
Tests for the --help-orders flag.
c                   V ^8  d   QhRR/# r)   r    )r!   s   "r"   r#   HelpOrderTests.__annotate__  s     B B Br$   c                   V P                  \        R\        4       ;p4       V P                  \        \
        P                  ! 4       P                  R.4      pV P                  VP                  ^ 4       VP                  4       pRp\
        P                  P                  4        Ff  w  pw  rg\        P                  ! \        P                  ! V4       R\        P                  ! V4       2V4      pV P!                  WWS3,          R7       Kh  	  R# )zC
--help-orders prints each of the available orders and then exits.
stdoutz--help-ordersz4%r with its description not properly described in %rz.*rZ  N)rk   r   r   r  r/  r   r3   r4   r   coder   
_runOrdersitemsresearchescaper:  )	rL   r  r  outputr[  	orderName	orderDesc_matchs	   &        r"   &test_help_ordersPrintsSynopsisAndQuits5HelpOrderTests.test_help_ordersPrintsSynopsisAndQuits  s     	

3HJ"6&7446G
 	1%"D).)9)9)?)?)A%I~	II99Y'(299Y+?*@AE
 OOEi-@'@OA *Br$   r    N)r^   r_   r`   ra   rb   r  rc   r    r$   r"   r  r    s    B Br$   r  )E
__future__r   rl   rs  r  r   r|  r_  ior   typingr   r   r   hamcrestr   r   
hypothesisr	   hypothesis.strategiesr
   twisted.loggerr   twisted.pythonr   twisted.python.filepathr   r   twisted.python.usager   twisted.scriptsr   twisted.trialtwisted.trial._dist.disttrialr   twisted.trial._dist.functionalr   twisted.trial.runnerr   r   r   r   r   twisted.trial.test.test_loaderr   matchersr   
__import__r;   r&   r.   r6   r@   rJ   SynchronousTestCaserB   re   r   r   r@  rn  r  TestCaser  r  r   r4  r@  r  r    r$   r"   <module>r     s   # 	 	 	 
      1  . !  7 + ! " 9 2  5 "	J	, =.9 =G8// =G@45(">"> 45n9X11 98Ih22 IXL855 L8^3/H00 3/l0OH00 0OfOV8$$ OVdW+h'' W+tJx   J:/X.. /:y
"" y
xBX&& Br$   