ó
    ×›‘hÁá  ã                   ó¦  • S r SSKrSSKrSSKrSSKrSSKJr  SSKJrJ	r	  SSK
Jr  SSKJrJrJr  SSKJrJrJrJr  SSKJr  SS	KJr  SS
KJrJrJrJrJr  SSK J!r!J"r"  SSK#J$r$J%r%  SSK&J'r'J(r(J)r)  SSK*J+r+J,r,J-r-  SSK.J/r/   " S S5      r0 " S S\Rb                  5      r2 " S S\Rb                  5      r3 " S S\35      r4 " S S\25      r5 " S S\55      r6 " S S\Rb                  5      r7 " S  S!\25      r8 " S" S#\Rb                  5      r9 " S$ S%\Rb                  5      r: " S& S'\Rb                  5      r; " S( S)\Rb                  5      r< " S* S+\<5      r= " S, S-\Rb                  5      r> " S. S/\>5      r? " S0 S15      r@ " S2 S3\Rb                  5      rA " S4 S5\Rb                  5      rB " S6 S7\B5      rC " S8 S9\Rb                  5      rD " S: S;\B5      rE " S< S=\Rb                  5      rF " S> S?\C5      rG " S@ SA\R�                  5      rI " SB SC\Rb                  5      rJ " SD SE5      rK " SF SG\Rb                  5      rL " SH SI\Rb                  5      rMg)Jz&
Tests for L{twisted.trial.reporter}.
é    N)Úgetmro)ÚBytesIOÚStringIO)ÚType)ÚTestCaseÚ	TestSuiteÚexpectedFailure)Úassert_thatÚequal_toÚhas_itemÚ
has_length©Úlog)ÚFailure)ÚitrialÚreporterÚrunnerÚunittestÚutil)ÚUncleanWarningsReporterWrapperÚ_ExitWrapper)Ú	erroneousÚsample)ÚSkipTestÚTodoÚmakeTodoé   )Ú	isFailureÚmatches_resultÚsimilarFrameé   )Úafterc                   ó2   • \ rS rSrSrSrSrS rS rS r	Sr
g)	ÚBrokenStreamé#   zŒ
Stream-ish object that raises a signal interrupt error. We use this to make
sure that Trial still manages to write what it needs to write.
Fc                 ó   • Xl         g ©N)ÚfObj)Úselfr(   s     ÚdC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/trial/test/test_reporter.pyÚ__init__ÚBrokenStream.__init__,   ó   € Ø�	ó    c                 óœ   • U R                   (       a  U R                  R                  U5      $ SU l         [        [        R
                  S5      e)NTzInterrupted write)Úwrittenr(   ÚwriteÚOSErrorÚerrnoÚEINTR)r)   Úss     r*   r1   ÚBrokenStream.write/   s5   € Ø�<�<Ø—9‘9—?‘? 1Ó%Ð%ØˆŒÜ”e—k‘kÐ#6Ó7Ð7r.   c                 óš   • U R                   (       a  U R                  R                  5       $ SU l         [        [        R
                  S5      e)NTzInterrupted flush)Úflushedr(   Úflushr2   r3   r4   ©r)   s    r*   r9   ÚBrokenStream.flush5   s3   € Ø�<�<Ø—9‘9—?‘?Ó$Ð$ØˆŒÜ”e—k‘kÐ#6Ó7Ð7r.   )r(   r8   r0   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r0   r8   r+   r1   r9   Ú__static_attributes__© r.   r*   r$   r$   #   s"   † ñð
 €GØ€Gòò8õ8r.   r$   c                   ó   • \ rS rSrS rSrg)Ú
StringTesté<   c           	      ó,  • [        [        S U5      5      nU R                  [        U5      [        U5      :*  S[        U5      [        U5      4-  5        [	        [
        R                  " S5      5      n[        [        X5      5       HŠ  u  nu  pVUc  M  [        U[        5      (       a  U R                  XVSXEU4-  5        M;  [        XS5      (       a2  U R                  UR                  U5      SXER                  U4-  5        M}  [        SU< 35      e   g )Nz2Must have more observed than expectedlines %d < %dÚ zLine %d: %r not in %rz#Line %d: %r did not match string %rz"don't know what to do with object )ÚlistÚfilterÚ
assertTrueÚlenÚtypeÚreÚcompileÚ	enumerateÚzipÚ
isinstanceÚstrÚassertSubstringÚmatchÚpatternÚ	TypeError)r)   ÚexpectÚoutputÚREGEX_PATTERN_TYPEÚline_numberÚexpÚouts          r*   ÚstringComparisonÚStringTest.stringComparison=   sú   € Ü”f˜T 6Ó*Ó+ˆØ�‰Ü�‹Kœ3˜v›;Ñ&ðÜ" 6›{¬C°«KÐ8ñ9ô	
ô
 "¤"§*¢*¨R£.Ó1ÐÜ'0´°VÓ1DÖ'EÑ#ˆK™˜#Ø‰{ÙÜ˜C¤×%Ñ%Ø×$Ñ$ØÐ5¸È3Ð8OÑOöô ˜C×4Ñ4Ø—‘Ø—I‘I˜c“NØ9Ø"§K¡K°Ð5ñ6öô  Ð"DÀSÁGÐ LÓMÐMò (Fr.   rB   N)r<   r=   r>   r?   r]   rA   rB   r.   r*   rD   rD   <   s   † õNr.   rD   c                   ó,   • \ rS rSrS rS rS rS rSrg)ÚTestResultTestséV   c                 ó8   • [         R                  " 5       U l        g r'   )r   Ú
TestResultÚresultr:   s    r*   ÚsetUpÚTestResultTests.setUpW   s   € Ü×)Ò)Ó+ˆ�r.   c                 óZ  •  [        S5      e! [          a;  nUnU R                  R                  U [        R                  " 5       5         S nAOS nAff = fU R                  R
                  S   S   nU R                  X#R                  5        U R                  [         UR                  5        g ©NÚfoor   r!   )	ÚRuntimeErrorrd   ÚaddErrorÚsysÚexc_infoÚerrorsÚassertEqualÚvaluerL   ©r)   ÚeÚexcValueÚfailures       r*   Útest_pyunitAddErrorÚ#TestResultTests.test_pyunitAddErrorZ   s…   € ð	7Ü˜uÓ%Ð%øÜó 	7ØˆHØ�K‰K× Ñ  ¤s§|¢|£~×6Ñ6ûð	7úð —+‘+×$Ñ$ QÑ'¨Ñ*ˆØ×Ñ˜§=¡=Ô1Ø×Ñœ w§|¡|Õ4s   ‚ �
A—1AÁAc                 ó~  •  U R                  S5      e! U R                    a;  nUnU R                  R                  U [        R                  " 5       5         S nAOS nAff = fU R                  R
                  S   S   nU R                  X#R                  5        U R                  U R                   UR                  5        g rh   )	ÚfailureExceptionrd   Ú
addFailurerl   rm   Úfailuresro   rp   rL   rq   s       r*   Útest_pyunitAddFailureÚ%TestResultTests.test_pyunitAddFailuree   s—   € ð	9Ø×'Ñ'¨Ó.Ð.øØ×$Ñ$ó 	9ØˆHØ�K‰K×"Ñ" 4¬¯ª«×8Ñ8ûð	9úð —+‘+×&Ñ& qÑ)¨!Ñ,ˆØ×Ñ˜§=¡=Ô1Ø×Ñ˜×.Ñ.°·±Õ=s   ‚ “A£1AÁAc                 ó®  • U R                  [        5         U R                  R                  U S5        SSS5        U R                  [        5         U R                  R                  U [	        S5      5        SSS5        U R                  [        5         U R                  R                  U [        [	        S5      SS45        SSS5        U R                  [        5         U R                  R                  U [        [	        S5      45        SSS5        g! , (       d  f       Næ= f! , (       d  f       N´= f! , (       d  f       Nz= f! , (       d  f       g= f)z˜
L{reporter.TestResult.addError} raises L{TypeError} if it is called with
an error that is neither a L{sys.exc_info}-like three-tuple nor a
L{Failure}.
zan errorNÚextra)ÚassertRaisesrV   rd   rk   Ú	Exceptionr:   s    r*   Útest_somethingElseÚ"TestResultTests.test_somethingElsep   så   € ð ×ÑœyÕ)Ø�K‰K× Ñ   zÔ2÷ *à×ÑœyÕ)Ø�K‰K× Ñ  ¤y°Ó'<Ô=÷ *à×ÑœyÕ)Ø�K‰K× Ñ Ø”y¤)¨JÓ"7¸¸wÐGô÷ *ð ×ÑœyÕ)Ø�K‰K× Ñ  ¬	´9¸ZÓ3HÐ'IÔJ÷ *Ð)÷ *Õ)úç)Õ)úç)Õ)ú÷ *Õ)ús/   –DÁ&D$Â.D5Ã,EÄ
D!Ä$
D2Ä5
EÅ
E©rd   N)	r<   r=   r>   r?   re   ru   r{   r�   rA   rB   r.   r*   r`   r`   V   s   † ò,ò	5ò	>õKr.   r`   c                   ó   • \ rS rSrS rSrg)ÚReporterRealtimeTestsé‚   c                 óL   • [        5       n[        R                  " USS9U l        g )NT)Úrealtime)r   r   ÚReporterrd   ©r)   rX   s     r*   re   ÚReporterRealtimeTests.setUpƒ   s   € Ü“ˆÜ×'Ò'¨¸Ñ>ˆ�r.   rƒ   N)r<   r=   r>   r?   re   rA   rB   r.   r*   r…   r…   ‚   s   † õ?r.   r…   c                   óŠ   • \ rS rSr\R
                  " S5      rSS jrS rS\	S\
R                  4S jrS	 rS
 rS rSS jrSrg)ÚErrorReportingTestséˆ   z^=+$ÚreturnNc                 ó    • [         R                  " 5       U l        [        5       U l        [
        R                  " U R                  5      U l        g r'   )r   Ú
TestLoaderÚloaderr   rX   r   r‰   rd   r:   s    r*   re   ÚErrorReportingTests.setUp‹   s1   € Ü×'Ò'Ó)ˆŒÜ“jˆŒÜ)1×):Ò):¸4¿;¹;Ó)Gˆ�r.   c                 óx   • U R                  U5      nUR                  5         U R                  R                  5       $ r'   )Ú	getResultÚdonerX   Úgetvalue)r)   Úsuiterd   s      r*   Ú	getOutputÚErrorReportingTests.getOutput�   s,   € Ø—‘ Ó&ˆØ�‰ŒØ�{‰{×#Ñ#Ó%Ð%r.   r˜   c                 óP   • UR                  U R                  5        U R                  $ r'   )Úrunrd   ©r)   r˜   s     r*   r•   ÚErrorReportingTests.getResult•   s   € Ø�	‰	�$—+‘+ÔØ�{‰{Ðr.   c           
      ód  • [         R                  nU R                  R                  U5      nU R	                  U5      R                  5       nU R                  SS[        R                  " S5      [        R                  " S5      SUR                   SUR                   S3/nU R                  XC5        g)	z¾
A test method which runs and has an error recorded against it is
reported in the output stream with the I{ERROR} tag along with a
summary of what error was reported and the ID of the test.
z[ERROR]ú"Traceback (most recent call last):z.^\s+File .*erroneous\.py., line \d+, in setUp$z5^\s+raise FoolishError..I am a broken setUp method..$zEtwisted.trial.test.erroneous.FoolishError: I am a broken setUp methodÚ.z
.test_noopN)r   ÚSynchronousTestFailureInSetUpr’   Ú	loadClassr™   Ú
splitlinesÚdoubleSeparatorrM   rN   r=   r<   r]   )r)   Úclsr˜   rX   rT   s        r*   Útest_formatErroredMethodÚ,ErrorReportingTests.test_formatErroredMethod™   sš   € ô ×5Ñ5ˆØ—‘×%Ñ% cÓ*ˆØ—‘ Ó&×1Ñ1Ó3ˆà× Ñ ØØ0Ü�JŠJÐHÓIÜ�JŠJÐSÓTð-ð �~‰~Ð˜a §¡˜~¨ZÐ8ð
ˆð 	×Ñ˜eÕ,r.   c                 ó  • U R                   R                  S5      nU R                  U5      R                  5       nU R                  SS[
        R                  " S5      [
        R                  " S5      SS/nU R                  X25        g)zÀ
A test method which runs and has a failure recorded against it is
reported in the output stream with the I{FAIL} tag along with a summary
of what failure was reported and the ID of the test.
z6twisted.trial.test.erroneous.TestRegularFail.test_failz[FAIL]r    z2^\s+File .*erroneous\.py., line \d+, in test_fail$z^\s+self\.fail\("I fail"\)$z'twisted.trial.unittest.FailTest: I failN)r’   Ú
loadByNamer™   r¤   r¥   rM   rN   r]   )r)   r˜   rX   rT   s       r*   Útest_formatFailedMethodÚ+ErrorReportingTests.test_formatFailedMethod°   sz   € ð —‘×&Ñ&ØDó
ˆð —‘ Ó&×1Ñ1Ó3ˆà× Ñ ØØ0Ü�JŠJÐLÓMÜ�JŠJÐ5Ó6Ø5ØDð
ˆð 	×Ñ˜eÕ,r.   c                 ó¾  • SSK Jn  [        R                  " U R                  R                  U5      [        R                  5      nU R                  U5      nSnSSSU4 H  nU R                  XS5        M     U R                  [        R                  " SU5      S5        U R                  [        R                  " S	5      /nU R                  XcR!                  5       5        g
)z¼
A problem encountered while running a doctest is reported in the output
stream with a I{FAIL} or I{ERROR} tag along with a summary of what
problem was encountered and the ID of the test.
r   )r   z0twisted.trial.test.erroneous.unexpectedExceptionz1/0ÚZeroDivisionErrorzException raised:zFail(ed|ure in) example:z;Couldn't match 'Failure in example: ' or 'Failed example: 'z\[(ERROR|FAIL)\]N)Útwisted.trial.testr   r   Údecorater’   ÚloadDoctestsr   Ú	ITestCaser™   rS   rJ   rM   Úsearchr¥   rN   r]   r¤   )r)   r   r˜   rX   ÚpathÚ	substringrW   s          r*   Útest_doctestErrorÚ%ErrorReportingTests.test_doctestErrorÅ   s¶   € õ 	1ä×!Ò! $§+¡+×":Ñ":¸9Ó"EÄv×GWÑGWÓXˆØ—‘ Ó&ˆØAˆØÐ!4Ð6IÈ4ÓPˆIØ× Ñ  Ö3ñ Qà�‰Ü�IŠIÐ0°&Ó9ØLô	
ð ×&Ñ&¬¯
ª
Ð3FÓ(GÐHˆØ×Ñ˜f×&7Ñ&7Ó&9Õ:r.   c                 ó‚  • [         R                  " S5      nU R                  [        U/5      5      n[	        U[        [        S5      [        S5      S95        UR                  u  u  p4[	        U[        U5      5        [	        U[        [        [        5      [        [        [        S5      5      [        [        SS5      5      S95        UR                  u  u  p5[	        U[        U5      5        [	        U[        [        UR                   5      [        [        [        S5      5      [        [        SS5      5      S95        g	)
a§  
When a function scheduled using L{IReactorTime.callLater} in a
test method raises an exception that exception is added to the test
result as an error.

This happens even if the test also fails and the test failure is also
added to the test result as a failure.

Only really necessary for testing the deprecated style of tests that
use iterate() directly. See
L{erroneous.DelayedCall.testHiddenException} for more details.
ÚtestHiddenExceptionr!   )rn   rz   zsomething blew upÚgozerroneous.py)rL   rp   Úframesz/Deliberate failure to mask the hidden exceptionN)r   ÚDelayedCallr•   ÚPyUnitTestSuiter
   r   r   rn   r   r   rj   r"   rR   r   r    rz   rx   )r)   Útestrd   Ú
actualCaseÚerrorrt   s         r*   Útest_hiddenExceptionÚ(ErrorReportingTests.test_hiddenExceptionÙ   s  € ô ×$Ò$Ð%:Ó;ˆà—‘¤°°Ó 7Ó8ˆÜØ”N¬*°Q«-Ä*ÈQÃ-ÑPô	
ð !'§¡ÑÑ	ˆ*Ü�Dœ( :Ó.Ô/ÜØÜÜœlÓ+ÜœC¤Ð*=Ó!>Ó?Ü¤¨T°>Ó BÓCñô	
ð #)§/¡/ÑÑ	ˆ*Ü�Dœ( :Ó.Ô/ÜØÜÜ˜d×3Ñ3Ó4ÜÜœÐ"SÓTóô  ¤Ð-BÀNÓ SÓTñõ		
r.   )r’   rX   rd   ©r�   N)r<   r=   r>   r?   rM   rN   r¥   re   r™   r½   r   r‰   r•   r§   r«   r¶   rÁ   rA   rB   r.   r*   r�   r�   ˆ   sH   † Ø—j’j Ó)€OôHò
&ð
˜ð °8×3DÑ3Dô ò-ò.-ò*;÷()
r.   r�   c                   óH   • \ rS rSrSrS	S jrS\S\R                  4S jr	Sr
g)
Ú(UncleanWarningWrapperErrorReportingTestsi  z’
Tests that the L{UncleanWarningsReporterWrapper} can sufficiently proxy
IReporter failure and error reporting methods to a L{reporter.Reporter}.
r�   Nc                 óÔ   • [         R                  " 5       U l        [        5       U l        [
        R                  " U R                  5      U l        [        U R
                  5      U l        g r'   )	r   r‘   r’   r   rX   r   r‰   r   rd   r:   s    r*   re   Ú.UncleanWarningWrapperErrorReportingTests.setUp  sA   € Ü×'Ò'Ó)ˆŒÜ“jˆŒÜ+3×+<Ò+<¸T¿[¹[Ó+IˆŒÜ4°T·]±]ÓCˆ�r.   r˜   c                 óP   • UR                  U R                  5        U R                  $ r'   )rœ   rd   r   r�   s     r*   r•   Ú2UncleanWarningWrapperErrorReportingTests.getResult  s   € Ø�	‰	�$—+‘+ÔØ�}‰}Ðr.   )r’   rX   r   rd   rÃ   )r<   r=   r>   r?   r@   re   r½   r   r‰   r•   rA   rB   r.   r*   rÅ   rÅ     s&   † ñô
Dð˜ð °8×3DÑ3D÷ r.   rÅ   c                   óD   • \ rS rSrS rS rS rS rS rS r	S r
S	 rS
rg)ÚTracebackHandlingTestsi  c                 ó>  • [        5       n[        R                  " U5      nUR                  U5        UR                  UR
                  -   nU R                  [        U5      S5        U R                  US   S   U5        UR                  US   S   R                  5      $ )z—
Run the given C{test}, make sure it fails and return the trimmed
frames.

@param test: The test case to run.

@return: The C{list} of frames trimmed.
r!   r   )
r   r   r‰   rœ   rz   rn   ro   rK   Ú_trimFramesr»   )r)   r¾   Ústreamrd   Úbadss        r*   ÚgetErrorFramesÚ%TracebackHandlingTests.getErrorFrames  s„   € ô “ˆÜ×"Ò" 6Ó*ˆØ�‰�ÔØ�‰ §¡Ñ.ˆØ×Ñœ˜T› AÔ&Ø×Ñ˜˜a™ ™ TÔ*Ø×!Ñ! $ q¡'¨!¡*×"3Ñ"3Ó4Ð4r.   c                 óŽ  • [        X5       H’  u  p4U R                  US   US   5        [        R                  R	                  US   5      S   R                  [        R                  5      nUS   R                  S5      nU R                  U[        U5      * S  U5        M”     U R                  [        U5      [        U5      5        g )Nr   r!   Ú/)rP   ro   Úosr´   ÚsplitextÚsplitÚseprK   )r)   ÚobservedFramesÚexpectedFramesÚobservedÚexpectedÚobservedSegsÚexpectedSegss          r*   ÚcheckFramesÚ"TracebackHandlingTests.checkFrames(  s©   € Ü"% nÖ"EÑˆHØ×Ñ˜X a™[¨(°1©+Ô6ÜŸ7™7×+Ñ+¨H°Q©KÓ8¸Ñ;×AÑAÄ"Ç&Á&ÓIˆLØ# A™;×,Ñ,¨SÓ1ˆLØ×Ñ˜\¬3¨|Ó+<Ð*<Ð*>Ð?ÀÖNñ	 #Fð
 	×Ñœ˜^Ó,¬c°.Ó.AÕBr.   c                 óx   • [         R                  " S5      nU R                  U5      nU R                  US/5        g )NÚ	test_fail)rá   útwisted/trial/test/erroneous©r   ÚTestRegularFailrÐ   rÞ   ©r)   r¾   r»   s      r*   Ú
test_basicÚ!TracebackHandlingTests.test_basic0  s6   € Ü×(Ò(¨Ó5ˆØ×$Ñ$ TÓ*ˆØ×Ñ˜Ð"OÐ!PÕQr.   c                 óz   • [         R                  " S5      nU R                  U5      nU R                  USS/5        g )NÚtest_subfail)ré   râ   )Ú
subroutinerâ   rã   rå   s      r*   Útest_subroutineÚ&TracebackHandlingTests.test_subroutine5  s>   € Ü×(Ò(¨Ó8ˆØ×$Ñ$ TÓ*ˆØ×ÑØà@Ø>ðõ	
r.   c                 óx   • [         R                  " S5      nU R                  U5      nU R                  US/5        g)z}
C{_trimFrames} removes traces of C{_runCallbacks} when getting an error
in a callback returned by a C{TestCase} based test.
rá   )Úcbztwisted/internet/taskN©r   ÚTestAsynchronousFailrÐ   rÞ   rå   s      r*   Útest_deferredÚ$TracebackHandlingTests.test_deferred@  s?   € ô
 ×-Ò-¨kÓ:ˆØ×$Ñ$ TÓ*ˆØ×ÑØð 0ðõ	
r.   c                 ór   • [         R                  " S 5      nU R                  / UR                  / 5      5        g r'   ©r   r‰   ro   rÍ   ©r)   rd   s     r*   Útest_noFramesÚ$TracebackHandlingTests.test_noFramesP  s-   € Ü×"Ò" 4Ó(ˆØ×Ñ˜˜V×/Ñ/°Ó3Õ4r.   c                 óv   • [         R                  " S 5      nU R                  S/UR                  S/5      5        g )Nz
fake framerô   rõ   s     r*   Útest_oneFrameÚ$TracebackHandlingTests.test_oneFrameT  s1   € Ü×"Ò" 4Ó(ˆØ×Ñ˜,˜¨×);Ñ);¸\¸NÓ)KÕLr.   c                 óx   • [         R                  " S5      nU R                  U5      nU R                  US/5        g)z�
C{_trimFrames} removes traces of C{runWithWarningsSuppressed} from
C{utils} when a synchronous exception happens in a C{TestCase}
based test.
Útest_exception)rü   râ   Nrï   rå   s      r*   rü   Ú%TracebackHandlingTests.test_exceptionX  s9   € ô ×-Ò-Ð.>Ó?ˆØ×$Ñ$ TÓ*ˆØ×Ñ˜Ð"TÐ!UÕVr.   rB   N)r<   r=   r>   r?   rÐ   rÞ   ræ   rë   rñ   rö   rù   rü   rA   rB   r.   r*   rË   rË     s.   † ò5ò"CòRò
	
ò
ò 5òMõWr.   rË   c                   ó,   • \ rS rSrS rS rS rS rSrg)ÚFormatFailuresTestsic  c                 ó  •  [        S5      e! [          a    [        5       U l         Of = fSSSS/S//SSSS/S	///U R                  l        [	        5       U l        [        R                  " U R
                  5      U l        g )
Nri   z
foo/bar.pyé   )Úxr  )ÚyÚorangeÚquxé
   )ÚaÚtwo)ÚbÚMCMXCIX)	rj   r   Úfr»   r   rÎ   r   r‰   rd   r:   s    r*   re   ÚFormatFailuresTests.setUpd  s�   € ð	Ü˜uÓ%Ð%øÜó 	Ü“YˆDŽFð	úð �L ! h Z°/Ð1BÐCØ�L " | nÐ7GÐ6HÐIð
ˆ�‰Œô “jˆŒÜ×'Ò'¨¯©Ó4ˆ�s   ‚ �)¨)c           	      óê   • U R                   R                  U R                  5      nU R                  SS[        R
                  " S5      S[        R
                  " S5      S/UR                  5       5        g )Nr    z#  File "foo/bar.py", line 5, in fooz^\s*$z$  File "foo/bar.py", line 10, in quxzRuntimeError: foo)rd   Ú_formatFailureTracebackr  r]   rM   rN   r¤   )r)   Útbs     r*   Útest_formatDefaultÚ&FormatFailuresTests.test_formatDefaultp  s\   € Ø�[‰[×0Ñ0°·±Ó8ˆØ×Ñà4Ø5Ü—
’
˜8Ó$Ø6Ü—
’
˜8Ó$Ø#ðð �M‰M‹Oõ
	
r.   c                 ód   • SnSnU R                   R                  U5      nU R                  X#5        g )Nz®
  File "twisted/trial/unittest.py", line 256, in failUnlessSubstring
    return self.failUnlessIn(substring, astring, msg)
exceptions.TypeError: iterable argument required

z­
  File "twisted/trial/unittest.py", line 256, in failUnlessSubstring
    return self.failUnlessIn(substring, astring, msg)
exceptions.TypeError: iterable argument required
)rd   r  ro   )r)   r  rÛ   Ú	formatteds       r*   Útest_formatStringÚ%FormatFailuresTests.test_formatString~  s4   € ðˆðˆð
 —K‘K×7Ñ7¸Ó;ˆ	Ø×Ñ˜Õ-r.   c                 óÌ   • U R                   R                  S S  nU R                  R                  U R                   5        U R	                  U R                   R                  U5        g r'   )r  r»   rd   r  ro   )r)   r»   s     r*   Útest_mutationÚ!FormatFailuresTests.test_mutation�  sB   € Ø—‘—‘™qÐ!ˆà�‰×+Ñ+¨D¯F©FÔ3Ø×Ñ˜Ÿ™Ÿ™¨Õ/r.   )r  rd   rÎ   N)	r<   r=   r>   r?   re   r  r  r  rA   rB   r.   r*   rÿ   rÿ   c  s   † ò
5ò
ò.õ0r.   rÿ   c                   ó>   • \ rS rSrS rS rS rS rS rS r	S r
S	rg
)ÚPyunitNamesTestsi”  c                 óX   • [        5       U l        [        R                  " S5      U l        g ©NÚtest_foo)r   rÎ   r   Ú
PyunitTestr¾   r:   s    r*   re   ÚPyunitNamesTests.setUp•  s   € Ü“jˆŒÜ×%Ò% jÓ1ˆ�	r.   c                 óÒ   • [         R                  " U R                  5      nUR                  U R                  5        U R                  R                  5       nU R                  US5        g )Nz2twisted.trial.test.sample.PyunitTest.test_foo ... )r   ÚVerboseTextReporterrÎ   Ú	startTestr¾   r—   ro   ©r)   rd   rX   s      r*   Útest_verboseReporterÚ%PyunitNamesTests.test_verboseReporter™  sK   € Ü×-Ò-¨d¯k©kÓ:ˆØ×Ñ˜Ÿ™Ô#Ø—‘×%Ñ%Ó'ˆØ×Ñ˜Ð!UÕVr.   c                 óJ  • [         R                  " U R                  5      nUR                  U R                  5        U R                  R                  5       nUR                  5       S   R                  5       nU R                  X!R                  U R                  5      S-   5        g ©Néÿÿÿÿz ...©
r   ÚTreeReporterrÎ   r"  r¾   r—   r¤   Ústripro   ÚgetDescriptionr#  s      r*   Útest_treeReporterÚ"PyunitNamesTests.test_treeReporterŸ  óx   € Ü×&Ò& t§{¡{Ó3ˆØ×Ñ˜Ÿ™Ô#Ø—‘×%Ñ%Ó'ˆØ×"Ñ"Ó$ RÑ(×.Ñ.Ó0ˆØ×Ñ˜×!6Ñ!6°t·y±yÓ!AÀFÑ!JÕKr.   c                 óž   • [         R                  " U R                  5      nUR                  U R                  5      nU R                  US5        g r  ©r   r*  rÎ   r,  r¾   ro   r#  s      r*   Útest_getDescriptionÚ$PyunitNamesTests.test_getDescription¦  ó:   € Ü×&Ò& t§{¡{Ó3ˆØ×&Ñ& t§y¡yÓ1ˆØ×Ñ˜ Õ,r.   c                 ó6  • [         R                  " U R                  5      nU R                  R	                  U5        UR                  5         U R                  R                  5       R                  5       R                  S5      nU R                  USS / SQ5        g)a;  
The summary of L{reporter.MinimalReporter} is a simple list of numbers,
indicating how many tests ran, how many failed etc.

The numbers represents:
 * the run time of the tests
 * the number of tests run, printed 2 times for legacy reasons
 * the number of errors
 * the number of failures
 * the number of skips
Ú r!   N)Ú1r7  Ú0r8  r8  )
r   ÚMinimalReporterrÎ   r¾   rœ   Ú_printSummaryr—   r+  rÖ   ro   r#  s      r*   Útest_minimalReporterÚ%PyunitNamesTests.test_minimalReporter«  sq   € ô ×)Ò)¨$¯+©+Ó6ˆØ�	‰	�‰�fÔØ×ÑÔØ—‘×%Ñ%Ó'×-Ñ-Ó/×5Ñ5°cÓ:ˆØ×Ñ˜  ˜Ò%>Õ?r.   c                 óV  ^• / SQm[         R                  " U R                  5      nU4S jUl        U R                  R                  U5        UR                  5         U R                  R                  5       R                  5       R                  S5      nUS   nU R                  US5        g)z\
L{reporter.MinimalReporter} reports the time to run the tests as first
data in its output.
)g      ð?g333333ó?g      ø?gffffffþ?c                  ó&   >• T R                  S5      $ ©Nr   )Úpop)Útimess   €r*   Ú<lambda>Ú;PyunitNamesTests.test_minimalReporterTime.<locals>.<lambda>Ä  s   ø€  %§)¡)¨A¤,r.   r6  r   z0.7N)r   r9  rÎ   Ú_getTimer¾   rœ   r:  r—   r+  rÖ   ro   )r)   rd   rX   ÚtimerrA  s       @r*   Útest_minimalReporterTimeÚ)PyunitNamesTests.test_minimalReporterTime½  s€   ø€ ò
 %ˆÜ×)Ò)¨$¯+©+Ó6ˆÜ.ˆŒØ�	‰	�‰�fÔØ×ÑÔØ—‘×%Ñ%Ó'×-Ñ-Ó/×5Ñ5°cÓ:ˆØ�q‘	ˆØ×Ñ˜ Õ&r.   c                 óú   • [         R                  " U R                  5      nUR                  5         U R                  R	                  5       R                  5       R                  S5      nU R                  U/ SQ5        g)z^
The summary of L{reporter.MinimalReporter} is a list of zeroes when no
test is actually run.
r6  )r8  r8  r8  r8  r8  r8  N)r   r9  rÎ   r:  r—   r+  rÖ   ro   r#  s      r*   Útest_emptyMinimalReporterÚ*PyunitNamesTests.test_emptyMinimalReporterË  s[   € ô
 ×)Ò)¨$¯+©+Ó6ˆØ×ÑÔØ—‘×%Ñ%Ó'×-Ñ-Ó/×5Ñ5°cÓ:ˆØ×Ñ˜Ò!?Õ@r.   ©rÎ   r¾   N)r<   r=   r>   r?   re   r$  r-  r2  r;  rF  rI  rA   rB   r.   r*   r  r  ”  s)   † ò2òWòLò-ò
@ò$'õAr.   r  c                   ó6   • \ rS rSrSrS rS rS rS rS r	Sr
g	)
ÚDirtyReactorTestsiÖ  zè
The trial script has an option to treat L{DirtyReactorAggregateError}s as
warnings, as a migration tool for test authors. It causes a wrapper to be
placed around reporters that replaces L{DirtyReactorAggregatErrors} with
warnings.
c                 ó�   • [        [        R                  " S/S/5      5      U l        [	        5       U l        [        S5      U l        g )Nri   ÚbarÚtest_errorByDefault)r   r   ÚDirtyReactorAggregateErrorÚ
dirtyErrorr   rX   rM  r¾   r:   s    r*   re   ÚDirtyReactorTests.setUpÞ  s5   € Ü!¤$×"AÒ"AÀ5À'ÈEÈ7Ó"SÓTˆŒÜ“jˆŒÜ%Ð&;Ó<ˆ�	r.   c                 ó.  • [         R                  " U R                  S9nUR                  U R                  U R
                  5        U R                  [        UR                  5      S5        U R                  UR                  S   S   U R
                  5        g)zR
L{DirtyReactorAggregateError}s are reported as errors with the default
Reporter.
©rÎ   r!   r   N)	r   r‰   rX   rk   r¾   rR  ro   rK   rn   rõ   s     r*   rP  Ú%DirtyReactorTests.test_errorByDefaultã  si   € ô
 ×"Ò"¨$¯+©+Ñ6ˆØ�‰˜Ÿ	™	 4§?¡?Ô3Ø×Ñœ˜VŸ]™]Ó+¨QÔ/Ø×Ñ˜Ÿ™ qÑ)¨!Ñ,¨d¯o©oÕ>r.   c                 ó  • [        [        R                  " U R                  S95      nU R	                  [
        U R                  R                  5       [        R                  UR                  U R                  U R                  5        g)zk
L{DirtyReactorAggregateError}s are reported as warnings when using
the L{UncleanWarningsReporterWrapper}.
rU  N)r   r   r‰   rX   ÚassertWarnsÚUserWarningrR  ÚgetErrorMessageÚ__file__rk   r¾   rõ   s     r*   Útest_warningsEnabledÚ&DirtyReactorTests.test_warningsEnabledí  s\   € ô
 0´×0AÒ0AÈÏÉÑ0UÓVˆØ×ÑÜØ�O‰O×+Ñ+Ó-Ü×ÑØ�O‰OØ�I‰IØ�O‰Oõ	
r.   c                 óZ  • [        [        R                  " U R                  S95      nU R	                  [
        U R                  R                  5       [        R                  UR                  U R                  U R                  5        U R                  UR                  R                  / 5        g)zp
L{DirtyReactorAggregateError}s are I{not} reported as errors if the
L{UncleanWarningsReporterWrapper} is used.
rU  N)r   r   r‰   rX   rX  rY  rR  rZ  r[  rk   r¾   ro   Ú_originalReporterrn   rõ   s     r*   Útest_warningsMaskErrorsÚ)DirtyReactorTests.test_warningsMaskErrorsü  sz   € ô
 0´×0AÒ0AÈÏÉÑ0UÓVˆØ×ÑÜØ�O‰O×+Ñ+Ó-Ü×ÑØ�O‰OØ�I‰IØ�O‰Oô	
ð 	×Ñ˜×1Ñ1×8Ñ8¸"Õ=r.   c                 óf  • [        [        R                  " U R                  S95      nUR	                  U R
                  U R                  R                  U R                  R                  S45        U R                  [        UR                  R                  5      S5        U R                  UR                  R                  S   S   R                  U R                  R                  5        U R                  UR                  R                  S   S   R                  U R                  R                  5        g)aR  
Some annoying stuff can pass three-tuples to addError instead of
Failures (like PyUnit). The wrapper, of course, handles this case,
since it is a part of L{twisted.trial.itrial.IReporter}! But it does
not convert L{DirtyReactorAggregateError} to warnings in this case,
because nobody should be passing those in the form of three-tuples.
rU  Nr!   r   )r   r   r‰   rX   rk   r¾   rR  rL   rp   ro   rK   r_  rn   rõ   s     r*   Útest_dealsWithThreeTuplesÚ+DirtyReactorTests.test_dealsWithThreeTuples  sà   € ô 0´×0AÒ0AÈÏÉÑ0UÓVˆØ�‰˜Ÿ	™	 D§O¡O×$8Ñ$8¸$¿/¹/×:OÑ:OÐQUÐ#VÔWØ×Ñœ˜V×5Ñ5×<Ñ<Ó=¸qÔAØ×ÑØ×$Ñ$×+Ñ+¨AÑ.¨qÑ1×6Ñ6¸¿¹×8LÑ8Lô	
ð 	×ÑØ×$Ñ$×+Ñ+¨AÑ.¨qÑ1×7Ñ7¸¿¹×9NÑ9Nõ	
r.   )rR  rX   r¾   N)r<   r=   r>   r?   r@   re   rP  r\  r`  rc  rA   rB   r.   r*   rM  rM  Ö  s    † ñò=ò
?ò
ò>õ 
r.   rM  c                   ó2   • \ rS rSrS rS rS rS rS rSr	g)	ÚTrialNamesTestsi  c                 óX   • [        5       U l        [        R                  " S5      U l        g r  )r   rÎ   r   ÚFooTestr¾   r:   s    r*   re   ÚTrialNamesTests.setUp   s   € Ü“jˆŒÜ—N’N :Ó.ˆ�	r.   c                 ó  • [         R                  " U R                  5      nUR                  U R                  5        U R                  R                  5       nU R                  X R                  R                  5       S-   5        g )Nz ... )r   r!  rÎ   r"  r¾   r—   ro   Úidr#  s      r*   r$  Ú$TrialNamesTests.test_verboseReporter$  sW   € Ü×-Ò-¨d¯k©kÓ:ˆØ×Ñ˜Ÿ™Ô#Ø—‘×%Ñ%Ó'ˆØ×Ñ˜§¡§¡£°'Ñ!9Õ:r.   c                 óJ  • [         R                  " U R                  5      nUR                  U R                  5        U R                  R                  5       nUR                  5       S   R                  5       nU R                  X!R                  U R                  5      S-   5        g r'  r)  r#  s      r*   r-  Ú!TrialNamesTests.test_treeReporter*  r/  r.   c                 ó†   • [         R                  " U R                  5      nU R                  UR	                  U 5      S5        g)zA docstringÚtest_treeReporterWithDocstringsN)r   r*  rÎ   ro   r,  rõ   s     r*   rp  Ú/TrialNamesTests.test_treeReporterWithDocstrings1  s2   € ä×&Ò& t§{¡{Ó3ˆØ×Ñ˜×.Ñ.¨tÓ4Ð6WÕXr.   c                 óž   • [         R                  " U R                  5      nUR                  U R                  5      nU R                  US5        g r  r1  r#  s      r*   r2  Ú#TrialNamesTests.test_getDescription6  r4  r.   rK  N)
r<   r=   r>   r?   re   r$  r-  rp  r2  rA   rB   r.   r*   rf  rf    s   † ò/ò;òLòYõ
-r.   rf  c                   óH   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rSrg)Ú	SkipTestsi<  z5
Tests for L{reporter.Reporter}'s handling of skips.
c                 ó¢   • [        5       U l        [        R                  " U R                  5      U l        [
        R                  " S5      U l        g r  ©r   rÎ   r   r‰   rd   r   rh  r¾   r:   s    r*   re   ÚSkipTests.setUpA  ó1   € Ü“jˆŒÜ×'Ò'¨¯©Ó4ˆŒÜ—N’N :Ó.ˆ�	r.   c                 ó,   • [        UR                  5      $ )z6
Get the number of skips that happened to a reporter.
)rK   Úskipsrõ   s     r*   Ú	_getSkipsÚSkipTests._getSkipsF  s   € ô �6—<‘<Ó Ð r.   c                 ó¦   • U R                   R                  U R                  S5        U R                  U R	                  U R                   5      S5        g )Núsome reasonr!   )rd   ÚaddSkipr¾   ro   r|  r:   s    r*   Útest_accumulationÚSkipTests.test_accumulationL  s7   € Ø�‰×Ñ˜DŸI™I }Ô5Ø×Ñ˜Ÿ™¨¯©Ó4°aÕ8r.   c                 ó¤   • U R                   R                  U R                  S5        U R                  SU R                   R	                  5       5        g )Nr  T)rd   r€  r¾   ro   ÚwasSuccessfulr:   s    r*   Útest_successÚSkipTests.test_successP  s7   € Ø�‰×Ñ˜DŸI™I }Ô5Ø×Ñ˜˜tŸ{™{×8Ñ8Ó:Õ;r.   c                 óv  • U R                   R                  U R                  S5        U R                   R                  5         U R                  R                  5       R                  5       S   nSnU R                  UR                  U5      5        U R                  U[        U5      S R                  5       S5        g)zs
The summary of a successful run with skips indicates that the test
suite passed and includes the number of skips.
r  r(  úPASSED Nz	(skips=1))rd   r€  r¾   r–   rÎ   r—   r¤   rJ   Ú
startswithro   rK   r+  ©r)   rX   Úprefixs      r*   Útest_summaryÚSkipTests.test_summaryT  sŒ   € ð
 	�‰×Ñ˜DŸI™I }Ô5Ø�‰×ÑÔØ—‘×%Ñ%Ó'×2Ñ2Ó4°RÑ8ˆØˆØ�‰˜×)Ñ)¨&Ó1Ô2Ø×Ñ˜¤ F£ Ð.×4Ñ4Ó6¸ÕDr.   c                 ó  • U R                   R                  U R                  S5        U R                   R                  5         U R                  R                  5       R                  5       S   nU R                  UR                  5       S5        g)z_
The output at the end of a test run with skips includes the reasons
for skipping those tests.
r  é   N)	rd   r€  r¾   r–   rÎ   r—   r¤   ro   r+  rŠ   s     r*   Útest_basicErrorsÚSkipTests.test_basicErrors`  sb   € ð
 	�‰×Ñ˜DŸI™I }Ô5Ø�‰×ÑÔØ—‘×%Ñ%Ó'×2Ñ2Ó4°QÑ7ˆØ×Ñ˜Ÿ™›¨Õ7r.   c                 óþ   • U R                   R                  U R                  S5        U R                   R                  5         U R                  R                  5       R                  5       S   nU R                  US5        g)z�
Tests can be skipped without specifying a reason by setting the 'skip'
attribute to True. When this happens, the test output includes 'True'
as the reason.
Tr�  ÚTrueN)rd   r€  r¾   r–   rÎ   r—   r¤   ro   rŠ   s     r*   Útest_booleanSkipÚSkipTests.test_booleanSkipj  s\   € ð 	�‰×Ñ˜DŸI™I tÔ,Ø�‰×ÑÔØ—‘×%Ñ%Ó'×2Ñ2Ó4°QÑ7ˆØ×Ñ˜ Õ(r.   c                 óˆ  •  SS-    U R                  R                  U R                  W5        U R                  R	                  5         SR                  U R                  R                  5       R                  5       SS 5      R                  5       nU R                  U[        U5      5        g! [          a  nUn SnANµSnAff = f)zv
Skips can be raised as errors. When this happens, the error is
included in the summary at the end of the test suite.
r!   r   NÚ
r�  r  )r€   rd   r€  r¾   r–   ÚjoinrÎ   r—   r¤   r+  ro   rR   ©r)   rr   rÀ   rX   s       r*   Útest_exceptionSkipÚSkipTests.test_exceptionSkipu  s—   € ð
	Ø�ŠEð 	�‰×Ñ˜DŸI™I uÔ-Ø�‰×ÑÔØ—‘˜4Ÿ;™;×/Ñ/Ó1×<Ñ<Ó>¸qÀÐCÓD×JÑJÓLˆØ×Ñ˜¤ U£Õ,øô ó 	Ø�Eûð	ús   ‚B+ Â+
CÂ5B<Â<C©rd   rÎ   r¾   N)r<   r=   r>   r?   r@   re   r|  r�  r…  rŒ  r�  r”  rš  rA   rB   r.   r*   ru  ru  <  s0   † ñò/ò
!ò9ò<ò
Eò8ò	)õ-r.   ru  c                   ó$   • \ rS rSrSrS rS rSrg)ÚUncleanWarningSkipTestsi„  z\
Tests for skips on a L{reporter.Reporter} wrapped by an
L{UncleanWarningsReporterWrapper}.
c                 ób   • [         R                  U 5        [        U R                  5      U l        g r'   )ru  re   r   rd   r:   s    r*   re   ÚUncleanWarningSkipTests.setUpŠ  ó   € Ü�‰˜ÔÜ4°T·[±[ÓAˆ�r.   c                 ó@   • [        UR                  R                  5      $ )ze
Get the number of skips that happened to a reporter inside of an
unclean warnings reporter wrapper.
)rK   r_  r{  rõ   s     r*   r|  Ú!UncleanWarningSkipTests._getSkipsŽ  s   € ô
 �6×+Ñ+×1Ñ1Ó2Ð2r.   rƒ   N)r<   r=   r>   r?   r@   re   r|  rA   rB   r.   r*   rž  rž  „  s   † ñò
Bõ3r.   rž  c                   ól   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rSrg)Ú	TodoTestsi–  z5
Tests for L{reporter.Reporter}'s handling of todos.
c                 ó¢   • [        5       U l        [        R                  " U R                  5      U l        [
        R                  " S5      U l        g r  rw  r:   s    r*   re   ÚTodoTests.setUp›  ry  r.   c                 ó   • UR                   $ )z8
Get the expected failures that happened to a reporter.
)ÚexpectedFailuresrõ   s     r*   Ú	_getTodosÚTodoTests._getTodos   s   € ð ×&Ñ&Ð&r.   c                 ó   • UR                   $ )z;
Get the unexpected successes that happened to a reporter.
)ÚunexpectedSuccessesrõ   s     r*   Ú_getUnexpectedSuccessesÚ!TodoTests._getUnexpectedSuccesses¦  s   € ð ×)Ñ)Ð)r.   c                 óî   • U R                   R                  U R                  [        [	        5       5      [        S5      5        U R                  [        U R                  U R                   5      5      S5        g)zP
L{reporter.Reporter} accumulates the expected failures that it
is notified of.
útodo!r!   N)	rd   ÚaddExpectedFailurer¾   r   r€   r   ro   rK   rª  r:   s    r*   r�  ÚTodoTests.test_accumulation¬  sQ   € ð
 	�‰×&Ñ&Ø�I‰I”wœy›{Ó+¬X°gÓ->ô	
ð 	×Ñœ˜TŸ^™^¨D¯K©KÓ8Ó9¸1Õ=r.   c                 óh  • [        [        5       5      nU R                  R                  U R                  U5        U R                  U R                  5      u  u  p#nU R                  X R                  5        U R                  X15        U R                  [        U5      [        [        S5      5      5        g)z­
If no C{Todo} is provided to C{addExpectedFailure}, then
L{reporter.Reporter} makes up a sensible default.

This allows standard Python unittests to use Twisted reporters.
úTest expected to failN)	r   r€   rd   r²  r¾   rª  ro   Úreprr   )r)   rt   r¾   rÀ   Útodos        r*   Útest_noTodoProvidedÚTodoTests.test_noTodoProvided¶  s�   € ô œ)›+Ó&ˆØ�‰×&Ñ& t§y¡y°'Ô:Ø $§¡¨t¯{©{Ó ;ÑÑ	ˆ$�tØ×Ñ˜Ÿy™yÔ)Ø×Ñ˜Ô(Ø×Ñœ˜d›¤T¬(Ð3JÓ*KÓ%LÕMr.   c                 óÚ   • U R                   R                  U R                  [        [	        5       5      [        S5      5        U R                  SU R                   R                  5       5        g)zE
A test run is still successful even if there are expected failures.
r±  TN)rd   r²  r¾   r   r€   r   ro   r„  r:   s    r*   r…  ÚTodoTests.test_successÄ  sL   € ð 	�‰×&Ñ&Ø�I‰I”wœy›{Ó+¬X°gÓ->ô	
ð 	×Ñ˜˜tŸ{™{×8Ñ8Ó:Õ;r.   c                 ó  • U R                   R                  U R                  [        S5      5        U R	                  SU R                   R                  5       5        U R	                  [        U R                  U R                   5      5      S5        g)zœ
A test which is marked as todo but succeeds will have an unexpected
success reported to its result. A test run is still successful even
when this happens.
zHeya!Tr!   N)rd   ÚaddUnexpectedSuccessr¾   r   ro   r„  rK   r®  r:   s    r*   Útest_unexpectedSuccessÚ TodoTests.test_unexpectedSuccessÍ  sb   € ð 	�‰×(Ñ(¨¯©´H¸WÓ4EÔFØ×Ñ˜˜tŸ{™{×8Ñ8Ó:Ô;Ø×Ñœ˜T×9Ñ9¸$¿+¹+ÓFÓGÈÕKr.   c                 ó  • U R                   R                  U R                  5        U R                  U R                   5      u  u  pU R	                  XR                  5        U R	                  [        U5      [        [        S5      5      5        g)a  
A test which is marked as todo but succeeds will have an unexpected
success reported to its result. A test run is still successful even
when this happens.

If no C{Todo} is provided, then we make up a sensible default. This
allows standard Python unittests to use Twisted reporters.
rµ  N)rd   r½  r¾   r®  ro   r¶  r   ©r)   r¾   r·  s      r*   Útest_unexpectedSuccessNoTodoÚ&TodoTests.test_unexpectedSuccessNoTodo×  sc   € ð 	�‰×(Ñ(¨¯©Ô3Ø×5Ñ5°d·k±kÓB‰‰ˆ$Ø×Ñ˜Ÿy™yÔ)Ø×Ñœ˜d›¤T¬(Ð3JÓ*KÓ%LÕMr.   c                 ó¬  • U R                   R                  U R                  [        [	        5       5      [        S5      5        U R                   R                  5         U R                  R                  5       R                  5       S   nSnU R                  UR                  U5      5        U R                  U[        U5      S R                  5       S5        g)zc
The reporter's C{printSummary} method should print the number of
expected failures that occurred.
r  r(  rˆ  Nz(expectedFailures=1))rd   r²  r¾   r   r€   r   r–   rÎ   r—   r¤   rJ   r‰  ro   rK   r+  rŠ  s      r*   rŒ  ÚTodoTests.test_summaryå  s    € ð
 	�‰×&Ñ&Ø�I‰I”wœy›{Ó+¬X°mÓ-Dô	
ð 	�‰×ÑÔØ—‘×%Ñ%Ó'×2Ñ2Ó4°RÑ8ˆØˆØ�‰˜×)Ñ)¨&Ó1Ô2Ø×Ñ˜¤ F£ Ð.×4Ñ4Ó6Ð8NÕOr.   c                 óP  • U R                   R                  U R                  [        [	        5       5      [        S5      5        U R                   R                  5         U R                  R                  5       R                  5       S   R                  5       nU R                  US5        g)zL
The reporter's L{printErrors} method should include the value of the
Todo.
r  r�  zReason: 'some reason'N)rd   r²  r¾   r   r€   r   r–   rÎ   r—   r¤   r+  ro   rŠ   s     r*   r�  ÚTodoTests.test_basicErrorsó  sy   € ð
 	�‰×&Ñ&Ø�I‰I”wœy›{Ó+¬X°mÓ-Dô	
ð 	�‰×ÑÔØ—‘×%Ñ%Ó'×2Ñ2Ó4°QÑ7×=Ñ=Ó?ˆØ×Ñ˜Ð!8Õ9r.   c                 óÈ   • U R                   R                  U R                  [        [	        5       5      S5        U R                  [        U R                   R                  5        g)zz
Booleans CAN'T be used as the value of a todo. Maybe this sucks. This
is a test for current behavior, not a requirement.
TN)rd   r²  r¾   r   r€   r   r–   r:   s    r*   Útest_booleanTodoÚTodoTests.test_booleanTodoÿ  s?   € ð
 	�‰×&Ñ& t§y¡y´'¼)»+Ó2FÈÔMØ×Ñœ) T§[¡[×%5Ñ%5Õ6r.   c                 ó²  •  SS-    U R                  R                  U R                  [	        W5      [        S5      5        U R                  R                  5         SR                  U R                  R                  5       R                  5       SS 5      R                  5       nU R                  [        U5      U;   5        g! [          a  nUn SnANÊSnAff = f)zS
The exception for expected failures should be shown in the
C{printErrors} output.
r!   r   Nr±  r—  r�  )r€   rd   r²  r¾   r   r   r–   r˜  rÎ   r—   r¤   r+  rJ   rR   r™  s       r*   Útest_exceptionTodoÚTodoTests.test_exceptionTodo  s£   € ð
	Ø�ŠEð 	�‰×&Ñ& t§y¡y´'¸%³.Ä(È7ÓBSÔTØ�‰×ÑÔØ—‘˜4Ÿ;™;×/Ñ/Ó1×<Ñ<Ó>¸q¸rÐBÓC×IÑIÓKˆØ�‰œ˜E›
 fÑ,Õ-øô ó 	Ø�Eûð	ús   ‚C  Ã 
CÃ
CÃCc                 óÐ   •  " S S[         5      nU" S5      nUR                  U R                  5        U R                  [	        U R                  U R                  5      5      S5        g)ú\
Tests that use the standard library C{expectedFailure} feature worth
with Trial reporters.
c                   ó$   • \ rS rSr\S 5       rSrg)Ú@TodoTests.test_standardLibraryCompatibilityFailure.<locals>.Testi  c                 ó&   • U R                  S5        g )Nrt   )Úfailr:   s    r*   rá   ÚJTodoTests.test_standardLibraryCompatibilityFailure.<locals>.Test.test_fail  s   € à—	‘	˜)Õ$r.   rB   N)r<   r=   r>   r?   r	   rá   rA   rB   r.   r*   ÚTestrÑ    s   † Øñ%ó ó%r.   rÕ  rá   r!   N)ÚStdlibTestCaserœ   rd   ro   rK   rª  ©r)   rÕ  r¾   s      r*   Ú(test_standardLibraryCompatibilityFailureÚ2TodoTests.test_standardLibraryCompatibilityFailure  sL   € ô	%”>ô 	%ñ
 �KÓ ˆØ�‰�—‘ÔØ×Ñœ˜TŸ^™^¨D¯K©KÓ8Ó9¸1Õ=r.   c                 óÐ   •  " S S[         5      nU" S5      nUR                  U R                  5        U R                  [	        U R                  U R                  5      5      S5        g)rÏ  c                   ó$   • \ rS rSr\S 5       rSrg)Ú@TodoTests.test_standardLibraryCompatibilitySuccess.<locals>.Testi*  c                 ó   • g r'   rB   r:   s    r*   r…  ÚMTodoTests.test_standardLibraryCompatibilitySuccess.<locals>.Test.test_success+  s   € àr.   rB   N)r<   r=   r>   r?   r	   r…  rA   rB   r.   r*   rÕ  rÜ  *  s   † Øñó ór.   rÕ  r…  r!   N)rÖ  rœ   rd   ro   rK   r®  r×  s      r*   Ú(test_standardLibraryCompatibilitySuccessÚ2TodoTests.test_standardLibraryCompatibilitySuccess$  sN   € ô	”>ô 	ñ
 �NÓ#ˆØ�‰�—‘ÔØ×Ñœ˜T×9Ñ9¸$¿+¹+ÓFÓGÈÕKr.   rœ  N)r<   r=   r>   r?   r@   re   rª  r®  r�  r¸  r…  r¾  rÂ  rŒ  r�  rÉ  rÌ  rØ  rß  rA   rB   r.   r*   r¥  r¥  –  sR   † ñò/ò
'ò*ò>òNò<òLòNòPò
:ò7ò.ò>õLr.   r¥  c                   ó*   • \ rS rSrSrS rS rS rSrg)ÚUncleanWarningTodoTestsi4  zB
Tests for L{UncleanWarningsReporterWrapper}'s handling of todos.
c                 ób   • [         R                  U 5        [        U R                  5      U l        g r'   )r¥  re   r   rd   r:   s    r*   re   ÚUncleanWarningTodoTests.setUp9  r¡  r.   c                 ó.   • UR                   R                  $ )z\
Get the  todos that happened to a reporter inside of an unclean
warnings reporter wrapper.
)r_  r©  rõ   s     r*   rª  Ú!UncleanWarningTodoTests._getTodos=  s   € ð
 ×'Ñ'×8Ñ8Ð8r.   c                 ó.   • UR                   R                  $ )zt
Get the number of unexpected successes that happened to a reporter
inside of an unclean warnings reporter wrapper.
)r_  r­  rõ   s     r*   r®  Ú/UncleanWarningTodoTests._getUnexpectedSuccessesD  s   € ð
 ×'Ñ'×;Ñ;Ð;r.   rƒ   N)	r<   r=   r>   r?   r@   re   rª  r®  rA   rB   r.   r*   râ  râ  4  s   † ñòBò9õ<r.   râ  c                   ó$   • \ rS rSrSrS rS rSrg)ÚMockColorizeriL  zJ
Used by TreeReporterTests to make sure that output is colored correctly.
c                 ó   • / U l         g r'   r   )r)   rÎ   s     r*   r+   ÚMockColorizer.__init__Q  s	   € Øˆ�r.   c                 ó<   • U R                   R                  X!45        g r'   )r   Úappend)r)   ÚtextÚcolors      r*   r1   ÚMockColorizer.writeT  s   € Ø�‰�‰˜˜Õ&r.   r   N)r<   r=   r>   r?   r@   r+   r1   rA   rB   r.   r*   rê  rê  L  s   † ñòõ'r.   rê  c                   ó>   • \ rS rSrS rS rS rS rS rS r	S r
S	rg
)ÚTreeReporterTestsiX  c                 ó4  • [         R                  " S5      U l        [        5       U l        [
        R                  " U R                  5      U l        [        U R                  5      U R                  l	        U R                  R                  R                  U l
        g r  )r   rh  r¾   r   rÎ   r   r*  rd   rê  Ú
_colorizerr   r:   s    r*   re   ÚTreeReporterTests.setUpY  s]   € Ü—N’N :Ó.ˆŒ	Ü“jˆŒÜ×+Ò+¨D¯K©KÓ8ˆŒÜ!.¨t¯{©{Ó!;ˆ�‰ÔØ—;‘;×)Ñ)×-Ñ-ˆ�r.   c                 óH   •  SS-    W$ ! [          a    [        5       n U$ f = f)Nr!   r   )r®   r   )r)   r  s     r*   Ú	makeErrorÚTreeReporterTests.makeError`  s2   € ð	Ø�ŠEð ˆøô !ó 	Ü“	‰AØˆð	ús   ‚	 ‰! !c                 ó~  • U R                   R                  U R                  5        U R                   R                  5         U R	                  U R
                  S   U R                   R                  S45        U R	                  U R                  R                  5       R                  5       S   R                  5       S5        g)z_
The summary in case of success should have a good count of successes
and be colored properly.
r!   ÚPASSEDr(  z(successes=1)N)rd   Ú
addSuccessr¾   r–   ro   r   ÚSUCCESSrÎ   r—   r¤   r+  r:   s    r*   Útest_summaryColoredSuccessÚ,TreeReporterTests.test_summaryColoredSuccessg  sˆ   € ð
 	�‰×Ñ˜tŸy™yÔ)Ø�‰×ÑÔØ×Ñ˜Ÿ™ !™ t§{¡{×':Ñ':¸HÐ&EÔFØ×ÑØ�K‰K× Ñ Ó"×-Ñ-Ó/°Ñ3×9Ñ9Ó;¸_õ	
r.   c                 óÊ  •  [        S5      e! [          a2    U R                  R                  U [        R                  " 5       5         Of = fU R                  R                  5         U R                  U R                  S   U R                  R                  S45        U R                  U R                  R                  5       R                  5       S   R                  5       S5        g)z\
The summary in case of failure should have a good count of errors
and be colored properly.
ri   r!   ÚFAILEDr(  z
(errors=1)N)rj   rd   rk   rl   rm   r–   ro   r   ÚFAILURErÎ   r—   r¤   r+  r:   s    r*   Útest_summaryColoredFailureÚ,TreeReporterTests.test_summaryColoredFailures  s¦   € ð
	7Ü˜uÓ%Ð%øÜó 	7Ø�K‰K× Ñ  ¤s§|¢|£~Ö6ð	7úà�‰×ÑÔØ×Ñ˜Ÿ™ !™ t§{¡{×':Ñ':¸HÐ&EÔFØ×Ñ˜Ÿ™×-Ñ-Ó/×:Ñ:Ó<¸RÑ@×FÑFÓHÈ,ÕWs   ‚ �9A	ÁA	c                 óf  • U R                  SS/U R                  R                  S5      5        U R                  SS/U R                  R                  S5      5        U R                  S/U R                  R                  S5      5        U R                  / U R                  R                  S5      5        g)zo
The tree needs to get the segments of the test ID that correspond
to the module and class that it belongs to.
zfoo.barÚbazzfoo.bar.baz.quxri   rO  zfoo.bar.bazN)ro   rd   Ú_getPreludeSegmentsr:   s    r*   Útest_getPreludeÚ!TreeReporterTests.test_getPrelude€  s‘   € ð
 	×ÑØ˜Ð §¡× ?Ñ ?Ð@QÓ Rô	
ð 	×Ñ˜% ˜¨¯©×)HÑ)HÈÓ)WÔXØ×Ñ˜%˜ $§+¡+×"AÑ"AÀ)Ó"LÔMØ×Ñ˜˜TŸ[™[×<Ñ<¸UÓCÕDr.   c                 ó  •  [        S5      e! [          ak    U R                  R                  U [        R                  " 5       5        U R                  R                  U R
                  [        R                  " 5       5         Of = f [        S5      e! [          aH    [        R                  " S5      nU R                  R                  U[        R                  " 5       5         Of = fU R                  R                  5         U R                  R                  U R                  R                  U R                  R                  5      nU R                  US   S   X R
                  /5        U R                  US   S   U/5        g)z‹
If two different tests have the same error, L{Reporter._groupResults}
includes them together in one of the tuples in the list it returns.
ri   rO  Útest_barr   r!   N)rj   rd   rk   rl   rm   r¾   r   rh  r–   Ú_groupResultsrn   r  ro   )r)   r~   Úgroupeds      r*   Útest_groupResultsÚ#TreeReporterTests.test_groupResultsŒ  s  € ð
	<Ü˜uÓ%Ð%øÜó 	<Ø�K‰K× Ñ  ¤s§|¢|£~Ô6Ø�K‰K× Ñ  §¡¬C¯LªL«NÖ;ð	<úð	8Ü˜uÓ%Ð%øÜó 	8Ü—N’N :Ó.ˆEØ�K‰K× Ñ  ¬¯ª«Ö7ð	8úð 	�‰×ÑÔØ—+‘+×+Ñ+Ø�K‰K×Ñ §¡× CÑ Có
ˆð 	×Ñ˜ ™ A™¨¯y©yÐ(9Ô:Ø×Ñ˜ ™ A™¨¨Õ0s#   ‚ �A2BÂBÂB ÂAC#Ã"C#c           	      óº  • S n[         R                  " S5      n[         R                  " S5      n[         R                  " S5      nU R                  R	                  SUS4US4US4/U5        U R                  U R                  R                  5       SU R                  R                  UR                  5       UR                  5       UR                  5       S.-  5        g	)
z‘
L{Reporter._printResults} uses the results list and formatter callable
passed to it to produce groups of results to write to its output
stream.
c                 ó   • [        U 5      S-   $ )Nr—  )rR   )Úns    r*   Ú	formatterÚ6TreeReporterTests.test_printResults.<locals>.formatter©  s   € Ü�q“6˜D‘=Ð r.   r  r  ÚFOOr!   r   zW%(double separator)s
FOO
1

%(first)s
%(second)s
%(double separator)s
FOO
2

%(third)s
)zdouble separatorÚfirstÚsecondÚthirdN)
r   rh  r  rd   Ú_printResultsro   rÎ   r—   Ú_doubleSeparatorrk  )r)   r  r  r  r  s        r*   Útest_printResultsÚ#TreeReporterTests.test_printResults¢  sº   € ò	!ô —’˜zÓ*ˆÜ—’ 
Ó+ˆÜ×!Ò! *Ó-ˆØ�‰×!Ñ!Ø�U˜A�J ¨ ¨e°Q¨ZÐ8¸)ô	
ð 	×ÑØ�K‰K× Ñ Ó"ð
ð %)§K¡K×$@Ñ$@ØŸ™›Ø Ÿ)™)›+ØŸ™›ñ	ñõ	
r.   )r   rd   rÎ   r¾   N)r<   r=   r>   r?   re   rø  rþ  r  r  r  r  rA   rB   r.   r*   ró  ró  X  s'   † ò.òò

òXò
Eò1õ,#
r.   ró  c                   ó€   • \ rS rSr% Sr\R                  r\\	R                     \S'   S rS rS rS rS rS	 rS
 rSrg)ÚReporterInterfaceTestsiÈ  aW  
Tests for the bare interface of a trial reporter.

Subclass this test case and provide a different 'resultFactory' to test
that a particular reporter implementation will work with the rest of
Trial.

@cvar resultFactory: A callable that returns a reporter to be tested. The
    callable must take the same parameters as L{reporter.Reporter}.
ÚresultFactoryc                 óÞ   • [         R                  " S5      U l        [        5       U l        [
        R                  " 5       U l        U R                  U R                  U R                  S9U l	        g )Nr  ©Ú	publisher)
r   rh  r¾   r   rÎ   r   ÚLogPublisherr"  r  rd   r:   s    r*   re   ÚReporterInterfaceTests.setUpÖ  sJ   € Ü—N’N :Ó.ˆŒ	Ü“jˆŒÜ×)Ò)Ó+ˆŒØ×(Ñ(¨¯©ÀÇÁÐ(ÐOˆ�r.   c                 óP   • U R                  SU R                  R                  5        g)z$
shouldStop is False to begin with.
FN)ro   rd   Ú
shouldStopr:   s    r*   Útest_shouldStopInitiallyFalseÚ4ReporterInterfaceTests.test_shouldStopInitiallyFalseÜ  s   € ð 	×Ñ˜ §¡× 6Ñ 6Õ7r.   c                 ó„   • U R                   R                  5         U R                  SU R                   R                  5        g)z7
shouldStop becomes True soon as someone calls stop().
TN)rd   Ústopro   r&  r:   s    r*   Útest_shouldStopTrueAfterStopÚ3ReporterInterfaceTests.test_shouldStopTrueAfterStopâ  s.   € ð 	�‰×ÑÔØ×Ñ˜˜tŸ{™{×5Ñ5Õ6r.   c                 óX   • U R                  SU R                  R                  5       5        g)zC
wasSuccessful() is True when there have been no results reported.
TN)ro   rd   r„  r:   s    r*   Útest_wasSuccessfulInitiallyTrueÚ6ReporterInterfaceTests.test_wasSuccessfulInitiallyTrueé  s!   € ð 	×Ñ˜˜tŸ{™{×8Ñ8Ó:Õ;r.   c                 ó¢   • U R                   R                  U R                  5        U R                  SU R                   R	                  5       5        g)zO
wasSuccessful() is True when there have been only successes, False
otherwise.
TN)rd   rü  r¾   ro   r„  r:   s    r*   Ú$test_wasSuccessfulTrueAfterSuccessesÚ;ReporterInterfaceTests.test_wasSuccessfulTrueAfterSuccessesï  s7   € ð
 	�‰×Ñ˜tŸy™yÔ)Ø×Ñ˜˜tŸ{™{×8Ñ8Ó:Õ;r.   c                 óö   •  SS-    U R                  SU R                  R                  5       5        g! [          a<    U R                  R                  U R                  [        R
                  " 5       5         Npf = f)z@
wasSuccessful() becomes False after errors have been reported.
r!   r   FN)r®   rd   rk   r¾   rl   rm   ro   r„  r:   s    r*   Ú"test_wasSuccessfulFalseAfterErrorsÚ9ReporterInterfaceTests.test_wasSuccessfulFalseAfterErrors÷  s\   € ð	<Ø�ŠEð 	×Ñ˜ §¡× 9Ñ 9Ó ;Õ<øô !ó 	<Ø�K‰K× Ñ  §¡¬C¯LªL«NÖ;ð	<ús   ‚2 ²AA8Á7A8c                 ó  •  U R                  S5        U R                  SU R                  R                  5       5        g! U R                   a<    U R                  R                  U R                  [
        R                  " 5       5         Nvf = f)zB
wasSuccessful() becomes False after failures have been reported.
ri   FN)	rÓ  rx   rd   ry   r¾   rl   rm   ro   r„  r:   s    r*   Ú$test_wasSuccessfulFalseAfterFailuresÚ;ReporterInterfaceTests.test_wasSuccessfulFalseAfterFailures  sg   € ð	>Ø�I‰I�eÔð 	×Ñ˜ §¡× 9Ñ 9Ó ;Õ<øð ×$Ñ$ó 	>Ø�K‰K×"Ñ" 4§9¡9¬c¯lªl«nÖ=ð	>ús   ‚> ¾A	B
Â	B
©r"  rd   rÎ   r¾   N)r<   r=   r>   r?   r@   r   r‰   r  r   r   Ú	IReporterÚ__annotations__re   r'  r+  r.  r1  r4  r7  rA   rB   r.   r*   r  r  È  sH   ‡ ñ	ð -5×,=Ñ,=€M�4˜×(Ñ(Ñ)Ó=òPò8ò7ò<ò<ò=õ=r.   r  c                   óH   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rSrg)ÚReporterTestsi  z0
Tests for the base L{reporter.Reporter} class.
c                 ór   • [         R                  U 5        SU l        U R                  U R                  l        g r?  )r  re   Ú_timerrD  rd   r:   s    r*   re   ÚReporterTests.setUp  s'   € Ü×$Ñ$ TÔ*ØˆŒØ#Ÿ}™}ˆ�‰Õr.   c                 óD   • U =R                   S-  sl         U R                   $ ©Nr!   ©r?  r:   s    r*   rD  ÚReporterTests._getTime  s   € Ø�Š�qÑ�Ø�{‰{Ðr.   c                 óˆ  • U R                   R                  U R                  5        U R                   R                  U R                  5        U R	                  U R                   R
                  S:„  5        U R                  U R                   R                  S5        U R                  U R                   R                  5       S5        g )Nr   r!   T)	rd   r"  r¾   ÚstopTestrJ   Ú	_lastTimero   ÚtestsRunr„  r:   s    r*   Útest_startStopÚReporterTests.test_startStop  s€   € Ø�‰×Ñ˜dŸi™iÔ(Ø�‰×Ñ˜TŸY™YÔ'Ø�‰˜Ÿ™×-Ñ-°Ñ1Ô2Ø×Ñ˜Ÿ™×-Ñ-¨qÔ1Ø×Ñ˜Ÿ™×2Ñ2Ó4°dÕ;r.   c                 ó¢  • U R                  [        U R                  5      S9nUR                  S5        U R	                  U R                  R                  5       S5        U R                  R                  S5        U R                  R                  S5        UR                  SS5        U R	                  U R                  R                  5       S5        g)	z5
Test that the reporter safely writes to its stream.
rU  ÚHellozHello
r   z	Hello %s!ÚWorldzHello World!
N)r  r$   rÎ   Ú_writelnro   r—   ÚtruncateÚseekrõ   s     r*   Útest_brokenStreamÚReporterTests.test_brokenStream!  s™   € ð ×#Ñ#¬<¸¿¹Ó+DÐ#ÐEˆØ�‰˜Ô Ø×Ñ˜Ÿ™×-Ñ-Ó/°Ô;Ø�‰×Ñ˜QÔØ�‰×Ñ˜ÔØ�‰˜ WÔ-Ø×Ñ˜Ÿ™×-Ñ-Ó/Ð1AÕBr.   c           	      óÞ   • [        S5      nSnSnSnU R                  R                  XX4S9  U R                  U R                  R                  5       SX4UR                  S5      S   U4-  5        g	)
zp
L{reporter.Reporter} observes warnings emitted by the Twisted log
system and writes them to its output stream.
zsome warning textúexceptions.RuntimeWarningzpath/to/some/file.pyéG   ©ÚwarningÚcategoryÚfilenameÚlinenoz%s:%d: %s: %s
r¡   r(  N)ÚRuntimeWarningr"  Úmsgro   rÎ   r—   rÖ   )r)   ÚmessagerX  rY  rZ  s        r*   Útest_warningÚReporterTests.test_warning-  sw   € ô
 !Ð!4Ó5ˆØ.ˆØ)ˆØˆØ�‰×ÑØ¸ð 	ñ 	
ð 	×ÑØ�K‰K× Ñ Ó"Ø °8·>±>À#Ó3FÀrÑ3JÈGÐ TÑTõ	
r.   c                 óD   • U R                  5         U R                  5         g)zR
A warning emitted twice within a single test is only written to the
stream once.
N)r^  r:   s    r*   Útest_duplicateWarningSuppressedÚ-ReporterTests.test_duplicateWarningSuppressed>  s   € ð 	×ÑÔð 	×ÑÕr.   c                 óF  • U R                  S5      nU R                  R                  U5        U R                  R	                  S5        U R                  R                  5         U R                  5         U R                  R	                  S5        U R                  R                  5         U R                  R                  U5        U R                  R                  U5        U R                  R	                  S5        U R                  R                  5         U R                  5         g)zV
A warning emitted again after a new test has started is written to the
stream again.
Útest_warningEmittedForNewTestr   N)Ú	__class__rd   r"  rÎ   rP  rO  r^  rF  ©r)   r¾   s     r*   rd  Ú+ReporterTests.test_warningEmittedForNewTestI  sÓ   € ð
 �~‰~Ð=Ó>ˆØ�‰×Ñ˜dÔ#ð 	�‰×Ñ˜ÔØ�‰×ÑÔð 	×ÑÔð 	�‰×Ñ˜ÔØ�‰×ÑÔð 	�‰×Ñ˜TÔ"Ø�‰×Ñ˜dÔ#ð 	�‰×Ñ˜ÔØ�‰×ÑÔð 	×ÑÕr.   c                 ó@  • U R                   R                  5         U R                  R                  S5        U R                  R	                  5         U R
                  R                  [        S5      SSSS9  U R                  U R                  R                  5       S5        g)	zT
L{reporter.Reporter} stops observing log events when its C{done} method
is called.
r   zsome messagerT  zfile/name.pyé   rV  rG   N)
rd   r–   rÎ   rP  rO  r"  r\  r[  ro   r—   r:   s    r*   Útest_stopObservingÚ ReporterTests.test_stopObservingi  s}   € ð
 	�‰×ÑÔØ�‰×Ñ˜ÔØ�‰×ÑÔØ�‰×ÑÜ" >Ó2Ø0Ø#Øð	 	ñ 	
ð 	×Ñ˜Ÿ™×-Ñ-Ó/°Õ4r.   rC  N)r<   r=   r>   r?   r@   re   rD  rI  rQ  r^  ra  rd  rj  rA   rB   r.   r*   r=  r=    s1   † ñò-ò
ò<ò
Cò
ò"	òõ@5r.   r=  c                   ó   • \ rS rSrS rSrg)ÚSafeStreamTestsiz  c                 ó¼   • [        5       n[        U5      n[        R                  " U5      nUR	                  S5        U R                  UR                  5       S5        g)z{
Test that L{reporter.SafeStream} successfully write to its original
stream even if an interrupt happens during the write.
rL  N)r   r$   r   Ú
SafeStreamr1   ro   r—   )r)   rÎ   ÚbrokenÚsafes       r*   Ú	test_safeÚSafeStreamTests.test_safe{  sH   € ô
 “ˆÜ˜fÓ%ˆÜ×"Ò" 6Ó*ˆØ�
‰
�7ÔØ×Ñ˜Ÿ™Ó*¨GÕ4r.   rB   N)r<   r=   r>   r?   rr  rA   rB   r.   r*   rm  rm  z  s   † õ	5r.   rm  c                   ó°   • \ rS rSr% Sr\R                  r\\	R                     \S'   S rS rS rS rS rS	 rS
 rS rS rS rS rS rS rS rS rSrg)ÚSubunitReporterTestsi‡  zl
Tests for the subunit reporter.

This just tests that the subunit reporter implements the basic interface.
r  c                 ó  • [         R                  c  [        S5      e[        R                  " S5      U l        [        5       U l        [        R                  " 5       U l
        U R                  U R                  U R                  S9U l        g )Nz2Subunit not installed, cannot test SubunitReporterr  r!  )r   ÚTestProtocolClientr   r   rh  r¾   r   rÎ   r   r#  r"  r  rd   r:   s    r*   re   ÚSubunitReporterTests.setUp�  sb   € Ü×&Ñ&Ñ.ÜÐOÓPÐPä—N’N :Ó.ˆŒ	Ü“iˆŒÜ×)Ò)Ó+ˆŒØ×(Ñ(¨¯©ÀÇÁÐ(ÐOˆ�r.   c                 ó2  • [        5       n[        R                  " U5      n[        XQ5      " U0 UD6nUR	                  5       n[        U R
                  U5      " U0 UD6nU R                  Xh5        U R                  XpR                  R	                  5       5        g)aa  
Assert that 'methodName' on L{SubunitReporter} forwards to the
equivalent method on subunit.

Checks that the return value from subunit is returned from the
L{SubunitReporter} and that the reporter writes the same data to its
stream as subunit does to its own.

Assumes that the method on subunit has the same name as the method on
L{SubunitReporter}.
N)r   r   rw  Úgetattrr—   rd   ro   rÎ   )	r)   Ú
methodNameÚargsÚkwargsrÎ   ÚsubunitClientÚsubunitReturnÚsubunitOutputÚreporterReturns	            r*   ÚassertForwardsToSubunitÚ,SubunitReporterTests.assertForwardsToSubunit™  s~   € ô “ˆä ×3Ò3°FÓ;ˆÜ Ô:¸DÐKÀFÑKˆØŸ™Ó)ˆÜ  §¡¨jÔ9¸4ÐJÀ6ÑJˆØ×Ñ˜Ô7Ø×Ñ˜¯©×(<Ñ(<Ó(>Õ?r.   c                 ó¼   • [        XS5      nUc  g[        U5       H&  n [        XB5        U R                  [        XBU5        M(     g! [
        [        4 a       gf = f)a¯  
Remove 'methodName' from 'klass'.

If 'klass' does not have a method named 'methodName', then
'removeMethod' succeeds silently.

If 'klass' does have a method named 'methodName', then it is removed
using delattr. Also, methods of the same name are removed from all
base classes of 'klass', thus removing the method entirely.

@param klass: The class to remove the method from.
@param methodName: The name of the method to remove.
N)rz  r   ÚdelattrÚ
addCleanupÚsetattrÚAttributeErrorrV   )r)   Úklassr{  ÚmethodÚbases        r*   ÚremoveMethodÚ!SubunitReporterTests.removeMethod®  s_   € ô ˜¨DÓ1ˆØ‰>ØÜ˜5–MˆDðCÜ˜Ô)ð —‘¤¨¸6ÖBò "øô #¤IÐ.ó Úðús    AÁAÁAc                 ó$  • U R                  [        R                  S5         SS-    U R                  R                  5       nU R                  R                  S5        U R                  R                  S5        U R                  R                  U R                  5        U R                  R                  5       nU R                  X!5        g! [         a=    U R                  R                  U R                  [        R                  " 5       S5         Nçf = f)zy
Some versions of subunit don't have "addExpectedFailure". For these
versions, we report expected failures as successes.
r²  r!   r   r·  N)rŒ  r   rw  r®   rd   r²  r¾   rl   rm   rÎ   r—   rO  rP  rü  ro   )r)   ÚexpectedFailureOutputÚsuccessOutputs      r*   Ú.test_subunitWithoutAddExpectedFailureInstalledÚCSubunitReporterTests.test_subunitWithoutAddExpectedFailureInstalledÇ  sÊ   € ð
 	×Ñœ(×5Ñ5Ð7KÔLð	NØ�ŠEð !%§¡× 4Ñ 4Ó 6ÐØ�‰×Ñ˜QÔØ�‰×Ñ˜ÔØ�‰×Ñ˜tŸy™yÔ)ØŸ™×,Ñ,Ó.ˆØ×Ñ˜Õ>øô !ó 	NØ�K‰K×*Ñ*¨4¯9©9´c·l²l³nÀfÖMð	Nús   ¢C ÃADÄDc                 óÐ  • U R                  [        R                  S5        U R                  R	                  U R
                  S5        U R                  R                  5       nU R                  R                  S5        U R                  R                  S5        U R                  R                  U R
                  5        U R                  R                  5       nU R                  X!5        g)zb
Some versions of subunit don't have "addSkip". For these versions, we
report skips as successes.
r€  Úreasonr   N)rŒ  r   rw  rd   r€  r¾   rÎ   r—   rO  rP  rü  ro   )r)   Ú
skipOutputr�  s      r*   Ú#test_subunitWithoutAddSkipInstalledÚ8SubunitReporterTests.test_subunitWithoutAddSkipInstalledØ  sž   € ð
 	×Ñœ(×5Ñ5°yÔAØ�‰×Ñ˜DŸI™I xÔ0Ø—[‘[×)Ñ)Ó+ˆ
Ø�‰×Ñ˜QÔØ�‰×Ñ˜ÔØ�‰×Ñ˜tŸy™yÔ)ØŸ™×,Ñ,Ó.ˆØ×Ñ˜Õ3r.   c                 ó,  ^• / mU4S jnXR                   R                  l         SS-    U R                  TU R                  W4/5        g! [         a?    [        R
                  " 5       nU R                   R                  U R                  US5         Nhf = f)z¹
Some versions of subunit have "addExpectedFailure". For these
versions, when we call 'addExpectedFailure' on the test result, we
pass the error and test through to the subunit client.
c                 ó*   >• TR                  X45        g r'   ©rî  )r¾   rÀ   ÚaddExpectedFailureCallss     €r*   r²  ÚUSubunitReporterTests.test_addExpectedFailurePassedThrough.<locals>.addExpectedFailureî  s   ø€ Ø#×*Ñ*¨D¨=Õ9r.   r!   r   r·  N)rd   Ú_subunitr²  r®   rl   rm   r¾   ro   )r)   r²  rm   r›  s      @r*   Ú$test_addExpectedFailurePassedThroughÚ9SubunitReporterTests.test_addExpectedFailurePassedThroughæ  s‡   ø€ ð #%Ðõ	:ð
 3E�‰×ÑÔ/ð	HØ�ŠEð 	×ÑÐ0°D·I±I¸xÐ3HÐ2IÕJøô !ó 	HÜ—|’|“~ˆHØ�K‰K×*Ñ*¨4¯9©9°hÀÖGð	Hús   ¥A
 Á
ABÂBc                 óÔ   ^• / mU4S jnXR                   R                  l        U R                   R                  U R                  S5        U R	                  TU R                  S4/5        g)z¤
Some versions of subunit have "addSkip". For these versions, when we
call 'addSkip' on the test result, we pass the test and reason through
to the subunit client.
c                 ó*   >• TR                  X45        g r'   rš  )r¾   r”  ÚaddSkipCallss     €r*   r€  ÚESubunitReporterTests.test_addSkipSendsSubunitAddSkip.<locals>.addSkip  s   ø€ Ø×Ñ  Õ/r.   r”  N)rd   r�  r€  r¾   ro   )r)   r€  r¢  s     @r*   Útest_addSkipSendsSubunitAddSkipÚ4SubunitReporterTests.test_addSkipSendsSubunitAddSkipû  sU   ø€ ð ˆõ	0ð
 (/�‰×ÑÔ$Ø�‰×Ñ˜DŸI™I xÔ0Ø×Ñ˜¨¯©°HÐ(=Ð'>Õ?r.   c                 óŒ   • U R                   R                  5         U R                  SU R                  R	                  5       5        g)z}
The subunit reporter doesn't need to print out a summary -- the stream
of results is everything. Thus, done() does nothing.
r.   N)rd   r–   ro   rÎ   r—   r:   s    r*   Útest_doneDoesNothingÚ)SubunitReporterTests.test_doneDoesNothing  s1   € ð
 	�‰×ÑÔØ×Ñ˜˜dŸk™k×2Ñ2Ó4Õ5r.   c                 ó<   • U R                  SU R                  5        g)zD
SubunitReporter.startTest() sends the subunit 'startTest' message.
r"  N©r‚  r¾   r:   s    r*   Ú#test_startTestSendsSubunitStartTestÚ8SubunitReporterTests.test_startTestSendsSubunitStartTest  s   € ð 	×$Ñ$ [°$·)±)Õ<r.   c                 ó<   • U R                  SU R                  5        g)zB
SubunitReporter.stopTest() sends the subunit 'stopTest' message.
rF  Nrª  r:   s    r*   Ú!test_stopTestSendsSubunitStopTestÚ6SubunitReporterTests.test_stopTestSendsSubunitStopTest  s   € ð 	×$Ñ$ Z°·±Õ;r.   c                 ó<   • U R                  SU R                  5        g)zF
SubunitReporter.addSuccess() sends the subunit 'addSuccess' message.
rü  Nrª  r:   s    r*   Ú%test_addSuccessSendsSubunitAddSuccessÚ:SubunitReporterTests.test_addSuccessSendsSubunitAddSuccess   s   € ð 	×$Ñ$ \°4·9±9Õ=r.   c                 ó”   •  SS-    U R                  SU R                  W5        g! [          a    [        R                  " 5       n N?f = f)zB
SubunitReporter.addError() sends the subunit 'addError' message.
r!   r   rk   N)r®   rl   rm   r‚  r¾   )r)   rÀ   s     r*   Ú!test_addErrorSendsSubunitAddErrorÚ6SubunitReporterTests.test_addErrorSendsSubunitAddError&  sB   € ð	#Ø�ŠEð 	×$Ñ$ Z°·±¸EÕBøô !ó 	#Ü—L’L“NŠEð	#ús   ‚% ¥AÁAc                 ó¸   •  U R                  S5        U R	                  SU R
                  W5        g! U R                   a    [        R                  " 5       n NEf = f)zF
SubunitReporter.addFailure() sends the subunit 'addFailure' message.
Úhellory   N)rÓ  rx   rl   rm   r‚  r¾   )r)   rt   s     r*   Ú%test_addFailureSendsSubunitAddFailureÚ:SubunitReporterTests.test_addFailureSendsSubunitAddFailure0  sM   € ð	%Ø�I‰I�gÔð 	×$Ñ$ \°4·9±9¸gÕFøð ×$Ñ$ó 	%Ü—l’l“nŠGð	%ús   ‚1 ±%AÁAc                 ó6  • [        5       n[        R                  " U5      nUR                  U R                  5        UR                  5       nU R                  R                  U R                  5        U R                  X0R                  R                  5       5        g)zv
SubunitReporter.addFailure() sends the subunit 'addSuccess' message,
since subunit doesn't model unexpected success.
N)
r   r   rw  rü  r¾   r—   rd   r½  ro   rÎ   )r)   rÎ   r~  r€  s       r*   Ú/test_addUnexpectedSuccessSendsSubunitAddSuccessÚDSubunitReporterTests.test_addUnexpectedSuccessSendsSubunitAddSuccess:  sj   € ô
 “ˆÜ ×3Ò3°FÓ;ˆØ× Ñ  §¡Ô+ØŸ™Ó)ˆØ�‰×(Ñ(¨¯©Ô3Ø×Ñ˜¯©×(<Ñ(<Ó(>Õ?r.   c                 óÚ   • [         R                  " 5       R                  S5      nUR                  U R                  5        U R
                  R                  5       nU R                  SU5        g)z3
Load-time errors are reported like normal errors.
Údoesntexists   doesntexistN)r   r‘   rª   rœ   rd   rÎ   r—   ÚassertIn)r)   r¾   rX   s      r*   Útest_loadTimeErrorsÚ(SubunitReporterTests.test_loadTimeErrorsF  sO   € ô × Ò Ó"×-Ñ-¨mÓ<ˆØ�‰�—‘ÔØ—‘×%Ñ%Ó'ˆð 	�‰�n fÕ-r.   r9  N)r<   r=   r>   r?   r@   r   ÚSubunitReporterr  r   r   r:  r;  re   r‚  rŒ  r‘  r–  rž  r¤  r§  r«  r®  r±  r´  r¸  r»  rÀ  rA   rB   r.   r*   ru  ru  ‡  sw   ‡ ñð -5×,DÑ,D€M�4˜×(Ñ(Ñ)ÓDòPò@ò*Cò2?ò"4òKò*@ò"6ò=ò<ò>òCòGò
@õ	.r.   ru  c                   ó   • \ rS rSrSrS rSrg)Ú SubunitReporterNotInstalledTestsiR  z<
Test behaviour when the subunit reporter is not installed.
c                 óÆ   • [        5       nU R                  [        SS5        U R                  [        [        R
                  U5      nU R                  S[        U5      5        g)z…
If subunit is not installed, TestProtocolClient will be None, and
SubunitReporter will raise an error when you try to construct it.
rw  NzSubunit not available)r   Úpatchr   r   r€   rÂ  ro   rR   )r)   rÎ   rr   s      r*   Útest_subunitNotInstalledÚ9SubunitReporterNotInstalledTests.test_subunitNotInstalledW  sK   € ô
 “ˆØ�
‰
”8Ð1°4Ô8Ø×Ñœi¬×)AÑ)AÀ6ÓJˆØ×ÑÐ0´#°a³&Õ9r.   rB   N)r<   r=   r>   r?   r@   rÇ  rA   rB   r.   r*   rÄ  rÄ  R  s   † ñõ:r.   rÄ  c                   óR   • \ rS rSr% \R
                  r\\R                     \
S'   Srg)ÚTimingReporterTestsib  r  rB   N)r<   r=   r>   r?   r   ÚTimingTextReporterr  r   r   r:  r;  rA   rB   r.   r*   rÊ  rÊ  b  s   ‡ Ø,4×,GÑ,G€M�4˜×(Ñ(Ñ)ÖGr.   rÊ  c                   óP   • \ rS rSrSrS rS rSS jrS rS r	SS	 jr
S
 rS rSrg)ÚLoggingReporterif  zB
Simple reporter that stores the last test that was passed to it.
c                 óZ   • [         R                  R                  " U /UQ70 UD6  S U l        g r'   )r   r‰   r+   r¾   )r)   r|  r}  s      r*   r+   ÚLoggingReporter.__init__k  s'   € Ü×Ñ×"Ò" 4Ð9¨$Ò9°&Ò9Øˆ�	r.   c                 ó   • Xl         g r'   ©r¾   )r)   r¾   rÀ   s      r*   rk   ÚLoggingReporter.addErroro  r-   r.   Nc                 ó   • Xl         g r'   rÑ  )r)   r¾   rt   r·  s       r*   r²  Ú"LoggingReporter.addExpectedFailurer  r-   r.   c                 ó   • Xl         g r'   rÑ  )r)   r¾   rt   s      r*   ry   ÚLoggingReporter.addFailureu  r-   r.   c                 ó   • Xl         g r'   rÑ  )r)   r¾   Úskips      r*   r€  ÚLoggingReporter.addSkipx  r-   r.   c                 ó   • Xl         g r'   rÑ  rÁ  s      r*   r½  Ú$LoggingReporter.addUnexpectedSuccess{  r-   r.   c                 ó   • Xl         g r'   rÑ  rf  s     r*   r"  ÚLoggingReporter.startTest~  r-   r.   c                 ó   • Xl         g r'   rÑ  rf  s     r*   rF  ÚLoggingReporter.stopTest�  r-   r.   rÑ  r'   )r<   r=   r>   r?   r@   r+   rk   r²  ry   r€  r½  r"  rF  rA   rB   r.   r*   rÍ  rÍ  f  s/   † ñòòôòòôòõr.   rÍ  c                   ól   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rSrg)ÚAdaptedReporterTestsi…  z�
L{reporter._AdaptedReporter} is a reporter wrapper that wraps all of the
tests it receives before passing them on to the original reporter.
c                 ó.   • U R                  5       U l        g r'   )ÚgetWrappedResultÚwrappedResultr:   s    r*   re   ÚAdaptedReporterTests.setUp‹  s   € Ø!×2Ñ2Ó4ˆÕr.   c                 ó"   • UR                  5       $ r'   )rk  rf  s     r*   Ú_testAdapterÚ!AdaptedReporterTests._testAdapterŽ  s   € Ø�w‰w‹yÐr.   c                 ón   • U R                  UR                  R                  U R                  U5      5        g r'   )ro   r_  r¾   rç  )r)   rä  r¾   s      r*   ÚassertWrappedÚ"AdaptedReporterTests.assertWrapped‘  s*   € Ø×Ñ˜×8Ñ8×=Ñ=¸t×?PÑ?PÐQUÓ?VÕWr.   c                 ó<   •  Ue! [          a    [        5       s $ f = f)z~
Return a L{Failure} from raising the given exception.

@param exceptionInstance: The exception to raise.
@return: L{Failure}
)ÚBaseExceptionr   )r)   ÚexceptionInstances     r*   Ú
getFailureÚAdaptedReporterTests.getFailure”  s$   € ð	Ø#Ð#øÜó 	Ü“9Òð	ús   ‚ „šc                 óV   • [        5       n[        R                  " XR                  5      $ r'   )rÍ  r   Ú_AdaptedReporterrç  rõ   s     r*   rã  Ú%AdaptedReporterTests.getWrappedResult   s!   € Ü Ó"ˆÜ×(Ò(¨×1BÑ1BÓCÐCr.   c                 ó    • U R                   R                  X R                  [        5       5      5        U R	                  U R                   U 5        g)z7
C{addError} wraps its test with the provided adapter.
N)rä  rk   rï  rj   rê  r:   s    r*   Útest_addErrorÚ"AdaptedReporterTests.test_addError¤  s9   € ð 	×Ñ×#Ñ# D¯/©/¼,».Ó*IÔJØ×Ñ˜4×-Ñ-¨tÕ4r.   c                 ó    • U R                   R                  X R                  [        5       5      5        U R	                  U R                   U 5        g)z9
C{addFailure} wraps its test with the provided adapter.
N)rä  ry   rï  ÚAssertionErrorrê  r:   s    r*   Útest_addFailureÚ$AdaptedReporterTests.test_addFailure«  s:   € ð 	×Ñ×%Ñ% d¯O©O¼NÓ<LÓ,MÔNØ×Ñ˜4×-Ñ-¨tÕ4r.   c                 ó¢   • U R                   R                  X R                  [        S5      5      5        U R	                  U R                   U 5        g)z6
C{addSkip} wraps its test with the provided adapter.
ú	no reasonN)rä  r€  rï  r   rê  r:   s    r*   Útest_addSkipÚ!AdaptedReporterTests.test_addSkip²  s<   € ð 	×Ñ×"Ñ" 4¯©¼À+Ó9NÓ)OÔPØ×Ñ˜4×-Ñ-¨tÕ4r.   c                 ór   • U R                   R                  U 5        U R                  U R                   U 5        g)z8
C{startTest} wraps its test with the provided adapter.
N)rä  r"  rê  r:   s    r*   Útest_startTestÚ#AdaptedReporterTests.test_startTest¹  s.   € ð 	×Ñ×$Ñ$ TÔ*Ø×Ñ˜4×-Ñ-¨tÕ4r.   c                 ór   • U R                   R                  U 5        U R                  U R                   U 5        g)z7
C{stopTest} wraps its test with the provided adapter.
N)rä  rF  rê  r:   s    r*   Útest_stopTestÚ"AdaptedReporterTests.test_stopTestÀ  s.   € ð 	×Ñ×#Ñ# DÔ)Ø×Ñ˜4×-Ñ-¨tÕ4r.   c                 ó´   • U R                   R                  X R                  [        5       5      [	        S5      5        U R                  U R                   U 5        g)zA
C{addExpectedFailure} wraps its test with the provided adapter.
rü  N)rä  r²  rï  rj   r   rê  r:   s    r*   Útest_addExpectedFailureÚ,AdaptedReporterTests.test_addExpectedFailureÇ  sE   € ð 	×Ñ×-Ñ-Ø—/‘/¤,£.Ó1´4¸Ó3Dô	
ð 	×Ñ˜4×-Ñ-¨tÕ4r.   c                 ó    • U R                   R                  X R                  [        5       5      5        U R	                  U R                   U 5        g)z0
C{addExpectedFailure} works without a C{Todo}.
N)rä  r²  rï  rj   rê  r:   s    r*   Útest_expectedFailureWithoutTodoÚ4AdaptedReporterTests.test_expectedFailureWithoutTodoÐ  s9   € ð 	×Ñ×-Ñ-¨d·O±OÄLÃNÓ4SÔTØ×Ñ˜4×-Ñ-¨tÕ4r.   c                 ó†   • U R                   R                  U [        S5      5        U R                  U R                   U 5        g)zC
C{addUnexpectedSuccess} wraps its test with the provided adapter.
rü  N)rä  r½  r   rê  r:   s    r*   Útest_addUnexpectedSuccessÚ.AdaptedReporterTests.test_addUnexpectedSuccess×  s5   € ð 	×Ñ×/Ñ/°´d¸;Ó6GÔHØ×Ñ˜4×-Ñ-¨tÕ4r.   c                 ór   • U R                   R                  U 5        U R                  U R                   U 5        g)z2
C{addUnexpectedSuccess} works without a C{Todo}.
N)rä  r½  rê  r:   s    r*   Ú!test_unexpectedSuccessWithoutTodoÚ6AdaptedReporterTests.test_unexpectedSuccessWithoutTodoÞ  s.   € ð 	×Ñ×/Ñ/°Ô5Ø×Ñ˜4×-Ñ-¨tÕ4r.   )rä  N)r<   r=   r>   r?   r@   re   rç  rê  rï  rã  rõ  rù  rý  r   r  r  r	  r  r  rA   rB   r.   r*   rá  rá  …  sO   † ñò
5òòXò
òDò5ò5ò5ò5ò5ò5ò5ò5õ5r.   rá  c                   ó(   • \ rS rSrSrSS jrS rSrg)Ú
FakeStreamiæ  z|
A fake stream which C{isatty} method returns some predictable.

@ivar tty: returned value of C{isatty}.
@type tty: C{bool}
c                 ó   • Xl         g r'   ©Útty)r)   r  s     r*   r+   ÚFakeStream.__init__î  s   € Ø�r.   c                 ó   • U R                   $ r'   r  r:   s    r*   ÚisattyÚFakeStream.isattyñ  s   € Ø�x‰xˆr.   r  N)T)r<   r=   r>   r?   r@   r+   r  rA   rB   r.   r*   r  r  æ  s   † ñôõr.   r  c                   óH   • \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rSrg)ÚAnsiColorizerTestsiõ  z'
Tests for L{reporter._AnsiColorizer}.
c                 óJ   • [         R                  R                  5       U l        g r'   )rl   ÚmodulesÚcopyÚsavedModulesr:   s    r*   re   ÚAnsiColorizerTests.setUpú  s   € ÜŸK™K×,Ñ,Ó.ˆÕr.   c                 ó’   • [         R                  R                  5         [         R                  R                  U R                  5        g r'   )rl   r  ÚclearÚupdater  r:   s    r*   ÚtearDownÚAnsiColorizerTests.tearDowný  s*   € Ü�‰×ÑÔÜ�‰×Ñ˜4×,Ñ,Õ-r.   c                 ór   • U R                  [        R                  R                  [	        S5      5      5        g)zY
L{reporter._AnsiColorizer.supported} returns C{False} if the given
stream is not a TTY.
FN)ÚassertFalser   Ú_AnsiColorizerÚ	supportedr  r:   s    r*   Útest_supportedStdOutTTYÚ*AnsiColorizerTests.test_supportedStdOutTTY  s(   € ð
 	×Ñœ×0Ñ0×:Ñ:¼:ÀeÓ;LÓMÕNr.   c                 ó–   • S[         R                  S'   U R                  [        R                  R                  [        5       5      5        g)z_
L{reporter._AnsiColorizer.supported} returns C{False} if the curses
module can't be imported.
NÚcurses©rl   r  r'  r   r(  r)  r  r:   s    r*   Útest_supportedNoCursesÚ)AnsiColorizerTests.test_supportedNoCurses  s3   € ð
 !%Œ�‰�HÑØ×Ñœ×0Ñ0×:Ñ:¼:»<ÓHÕIr.   c                 óz  •  " S S5      nU" 5       [         R                  S'   U R                  [        R                  R                  [        5       5      5        U R                  [        R                  R                  [        5       5      5        U R                  [         R                  S   R                  S5        g)zÜ
L{reporter._AnsiColorizer.supported} returns C{True} if
C{curses.tigetnum} returns more than 2 supported colors. It only tries
to call C{curses.setupterm} if C{curses.tigetnum} previously failed
with a C{curses.error}.
c                   ó(   • \ rS rSr\rSrS rS rSr	g)Ú>AnsiColorizerTests.test_supportedSetupTerm.<locals>.fakecursesi  r   c                 ó.   • U =R                   S-  sl         g rB  ©re   r:   s    r*   Ú	setuptermÚHAnsiColorizerTests.test_supportedSetupTerm.<locals>.fakecurses.setupterm  ó   € Ø—
’
˜a‘–
r.   c                 óF   • U R                   (       a  gU R                  5       e)Nr�  )re   rÀ   ©r)   rp   s     r*   ÚtigetnumÚGAnsiColorizerTests.test_supportedSetupTerm.<locals>.fakecurses.tigetnum  s   € Ø—:—:ØàŸ*™*›,Ð&r.   rB   N©
r<   r=   r>   r?   rj   rÀ   re   r6  r;  rA   rB   r.   r*   Ú
fakecursesr3    s   † Ø ˆEØˆEò õ'r.   r>  r-  r!   N)	rl   r  rJ   r   r(  r)  r  ro   re   ©r)   r>  s     r*   Útest_supportedSetupTermÚ*AnsiColorizerTests.test_supportedSetupTerm  s{   € ÷	'ñ 	'ñ !+£Œ�‰�HÑØ�‰œ×/Ñ/×9Ñ9¼*»,ÓGÔHØ�‰œ×/Ñ/×9Ñ9¼*»,ÓGÔHà×ÑœŸ™ XÑ.×4Ñ4°aÕ8r.   c                 ó´   •  " S S5      nU" 5       [         R                  S'   U R                  [        R                  R                  [        5       5      5        g)z«
L{reporter._AnsiColorizer.supported} returns C{False} and doesn't try
to call C{curses.setupterm} if C{curses.tigetnum} returns something
different than C{curses.error}.
c                   ó   • \ rS rSr\rS rSrg)ÚGAnsiColorizerTests.test_supportedTigetNumWrongError.<locals>.fakecursesi2  c                 ó   • [        5       er'   )Ú
ValueErrorr:  s     r*   r;  ÚPAnsiColorizerTests.test_supportedTigetNumWrongError.<locals>.fakecurses.tigetnum5  s
   € Ü “lÐ"r.   rB   N©r<   r=   r>   r?   rj   rÀ   r;  rA   rB   r.   r*   r>  rD  2  s   † Ø ˆEõ#r.   r>  r-  Nr.  r?  s     r*   Ú test_supportedTigetNumWrongErrorÚ3AnsiColorizerTests.test_supportedTigetNumWrongError+  s?   € ÷	#ñ 	#ñ !+£Œ�‰�HÑØ×Ñœ×0Ñ0×:Ñ:¼:»<ÓHÕIr.   c                 ó´   •  " S S5      nU" 5       [         R                  S'   U R                  [        R                  R                  [        5       5      5        g)zs
L{reporter._AnsiColorizer.supported} returns C{False} if
C{curses.tigetnum} returns less than 2 supported colors.
c                   ó   • \ rS rSr\rS rSrg)ÚKAnsiColorizerTests.test_supportedTigetNumNotEnoughColor.<locals>.fakecursesiA  c                 ó   • grB  rB   r:  s     r*   r;  ÚTAnsiColorizerTests.test_supportedTigetNumNotEnoughColor.<locals>.fakecurses.tigetnumD  s   € Ør.   rB   NrH  rB   r.   r*   r>  rM  A  s   † Ø ˆEõr.   r>  r-  Nr.  r?  s     r*   Ú$test_supportedTigetNumNotEnoughColorÚ7AnsiColorizerTests.test_supportedTigetNumNotEnoughColor;  s?   € ÷	ñ 	ñ !+£Œ�‰�HÑØ×Ñœ×0Ñ0×:Ñ:¼:»<ÓHÕIr.   c                 ó  •  " S S5      nU" 5       [         R                  S'   U R                  [        R                  R                  [        5       5      5        U R                  [         R                  S   R                  S5        g)z‚
L{reporter._AnsiColorizer.supported} returns C{False} if
C{curses.tigetnum} raises an error, and calls C{curses.setupterm} once.
c                   ó(   • \ rS rSr\rSrS rS rSr	g)ÚCAnsiColorizerTests.test_supportedTigetNumErrors.<locals>.fakecursesiP  r   c                 ó.   • U =R                   S-  sl         g rB  r5  r:   s    r*   r6  ÚMAnsiColorizerTests.test_supportedTigetNumErrors.<locals>.fakecurses.setuptermT  r8  r.   c                 ó"   • U R                  5       er'   )rÀ   r:  s     r*   r;  ÚLAnsiColorizerTests.test_supportedTigetNumErrors.<locals>.fakecurses.tigetnumW  s   € Ø—j‘j“lÐ"r.   rB   Nr=  rB   r.   r*   r>  rT  P  s   † Ø ˆEØˆEò õ#r.   r>  r-  r!   N)	rl   r  r'  r   r(  r)  r  ro   re   r?  s     r*   Útest_supportedTigetNumErrorsÚ/AnsiColorizerTests.test_supportedTigetNumErrorsJ  s^   € ÷	#ñ 	#ñ !+£Œ�‰�HÑØ×Ñœ×0Ñ0×:Ñ:¼:»<ÓHÔIØ×ÑœŸ™ XÑ.×4Ñ4°aÕ8r.   )r  N)r<   r=   r>   r?   r@   re   r$  r*  r/  r@  rI  rP  rY  rA   rB   r.   r*   r  r  õ  s3   † ñò/ò.òOòJò9ò6Jò Jõ9r.   r  c                   ó0   • \ rS rSrSrS rS rS rS rSr	g)	ÚExitWrapperTestsi_  z%
Tests for L{reporter._ExitWrapper}.
c                 ó  • [        [        S5      5      U l        [        R                  " S5      U l        [        R                  " 5       U l        [        U R                  5      U l
        U R                  U R                  R                  5        g )NzI am a Failurer  )r   r€   rt   r   rh  r¾   r   rc   rd   r   Úwrappedr'  r&  r:   s    r*   re   ÚExitWrapperTests.setUpd  s\   € ÜœyÐ)9Ó:Ó;ˆŒÜ—N’N :Ó.ˆŒ	Ü×)Ò)Ó+ˆŒÜ# D§K¡KÓ0ˆŒØ×Ñ˜Ÿ™×0Ñ0Õ1r.   c                 ó(  • U R                   R                  U R                  U R                  5        U R	                  U R                   R
                  5        U R                  U R                  R                  U R                  U R                  4/5        g)zU
L{reporter._ExitWrapper} causes a wrapped reporter to stop after its
first failure.
N)	r^  ry   r¾   rt   rJ   r&  ro   rd   rz   r:   s    r*   Útest_stopOnFailureÚ#ExitWrapperTests.test_stopOnFailurek  s`   € ð
 	�‰×Ñ §	¡	¨4¯<©<Ô8Ø�‰˜Ÿ™×/Ñ/Ô0Ø×Ñ˜Ÿ™×-Ñ-°·±¸D¿L¹LÐ0IÐ/JÕKr.   c                 ó(  • U R                   R                  U R                  U R                  5        U R	                  U R                   R
                  5        U R                  U R                  R                  U R                  U R                  4/5        g)zS
L{reporter._ExitWrapper} causes a wrapped reporter to stop after its
first error.
N)	r^  rk   r¾   rt   rJ   r&  ro   rd   rn   r:   s    r*   Útest_stopOnErrorÚ!ExitWrapperTests.test_stopOnErrort  s`   € ð
 	�‰×Ñ˜dŸi™i¨¯©Ô6Ø�‰˜Ÿ™×/Ñ/Ô0Ø×Ñ˜Ÿ™×+Ñ+¨t¯y©y¸$¿,¹,Ð.GÐ-HÕIr.   c                 ó(  • U R                   R                  U R                  U R                  5        U R	                  U R                   R
                  5        U R                  U R                  R                  U R                  U R                  4/5        g)za
L{reporter._ExitWrapper} does not cause a wrapped reporter to stop
after an unexpected success.
N)	r^  r½  r¾   rt   r'  r&  ro   rd   r­  r:   s    r*   Ú#test_doesNotStopOnUnexpectedSuccessÚ4ExitWrapperTests.test_doesNotStopOnUnexpectedSuccess}  sb   € ð
 	�‰×)Ñ)¨$¯)©)°T·\±\ÔBØ×Ñ˜Ÿ™×0Ñ0Ô1Ø×Ñ˜Ÿ™×8Ñ8¸D¿I¹IÀtÇ|Á|Ð;TÐ:UÕVr.   )rt   rd   r¾   r^  N)
r<   r=   r>   r?   r@   re   ra  rd  rg  rA   rB   r.   r*   r\  r\  _  s   † ñò2òLòJõWr.   r\  )Nr@   r3   rÔ   rM   rl   Úinspectr   Úior   r   Útypingr   r   r   rÖ  r   r½   r	   Úhamcrestr
   r   r   r   Útwisted.pythonr   Útwisted.python.failurer   Útwisted.trialr   r   r   r   Útwisted.trial.reporterr   r   r¯   r   r   Útwisted.trial.unittestr   r   r   Ú_dist.test.matchersr   r   r    Úmatchersr"   r$   ÚSynchronousTestCaserD   r`   r…   r�   rÅ   rË   rÿ   r  rM  rf  ru  rž  r¥  râ  rê  ró  r  r=  rm  ru  rÄ  rÊ  r‰   rÍ  rá  r  r  r\  rB   r.   r*   Ú<module>ru     s4  ðñó Û 	Û 	Û 
Ý ß  Ý ÷ñ ÷ AÓ @å Ý *ß BÕ Bß Oß 0ß ;Ñ ;ß IÑ IÝ ÷8ñ 8ô2N�×-Ñ-ô Nô4)K�h×2Ñ2ô )KôX?˜Oô ?ôz
˜*ô z
ôzÐ/Bô ô"JW˜X×9Ñ9ô JWôZ.0˜*ô .0ôb?A�x×3Ñ3ô ?AôDF
˜×4Ñ4ô F
ôR-�h×2Ñ2ô -ô:E-�×,Ñ,ô E-ôP3˜iô 3ô$[L�×,Ñ,ô [Lô|<˜iô <÷0	'ñ 	'ôm
˜×4Ñ4ô m
ô`A=˜X×9Ñ9ô A=ôHk5Ð*ô k5ô\
5�h×2Ñ2ô 
5ôH.Ð1ô H.ôV: x×'CÑ'Cô :ô H˜-ô Hô�h×'Ñ'ô ô>^5˜8×7Ñ7ô ^5÷Bñ ôg9˜×5Ñ5ô g9ôT%W�x×3Ñ3õ %Wr.   