§
    Ètºf‰�  ã                  ó(  — d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZ d dl	m
Z
 d dlmZmZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZmZ d dlmZ d dlmZ d dlmZ d dlm Z  d dl!m"Z" d dl#m$Z$m%Z%m&Z&m'Z'm(Z( d dl)m*Z* ddl+m,Z,  e-d¦  «        Z.d9d„Z/d:d„Z0d;d„Z1d<d „Z2 e"e2e1¦  «        Z3 G d!„ d"ej4        ¦  «        Z5 G d#„ d$ej4        ¦  «        Z6 G d%„ d&ej4        ¦  «        Z7 G d'„ d(ej4        ¦  «        Z8 G d)„ d*ej4        ¦  «        Z9 G d+„ d,ej4        ¦  «        Z: G d-„ d.ej;        ¦  «        Z< G d/„ d0ej;        ¦  «        Z= G d1„ d2ej;        ¦  «        Z> G d3„ d4ej;        ¦  «        Z? G d5„ d6ej;        ¦  «        Z@ G d7„ d8ej;        ¦  «        ZAdS )=é    )ÚannotationsN)ÚStringIO)ÚList)Úassert_thatÚcontains_string)Úgiven)Úsampled_from)ÚLogger)Úutil)ÚFilePathÚ	IFilePath)Ú
UsageError)Útrial)Úunittest)ÚDistTrialRunner)Úcompose)ÚDestructiveTestSuiteÚ
TestLoaderÚ	TestSuiteÚTrialRunnerÚ_Runner)Ú	testNamesé   )ÚfileContentsr   ÚfilenameÚstrÚreturnc                ó6   — t          j        t          | ¦  «        S )z1
    For finding files in twisted/trial/test
    )r   ÚsibpathÚ__file__)r   s    ú]/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/twisted/trial/test/test_script.pyr   r   &   s   € õ Œ<� (Ñ+Ô+Ð+ó    ÚNonec                 óH   — t          ¦   «                              d¦  «         dS )z.
    Emit something to L{twisted.logger}.
    Ú	somethingN)r
   Úinfo© r"   r!   ÚlogSomethingr(   -   s    € õ �H„H‡M‚M�+ÑÔÐÐÐr"   Úargvú	List[str]útrial.Optionsc                óV   — t          j        ¦   «         }|                     | ¦  «         |S )z?
    Parse an argument list using trial's argument parser.
    )r   ÚOptionsÚparseOptions)r)   Úconfigs     r!   ÚparseArgumentsr0   4   s(   € õ Œ]‰_Œ_€FØ
×Ò˜ÑÔÐØ€Mr"   r/   c                óØ   — t          j        | ¦  «        }t          ¦   «         |_        t	          t
                               t          ¦  «        g¦  «        }|                     |¦  «         | S )zM
    Run L{logSomething} as a test method using the given configuration.
    )	r   Ú_makeRunnerr   Ústreamr   ÚpyunitÚFunctionTestCaser(   Úrun)r/   ÚrunnerÚsuites      r!   ÚrunFromConfigr9   =   sT   € õ Ô˜vÑ&Ô&€FÝ‘J”J€F„MÝ•v×.Ò.­|Ñ<Ô<Ð=Ñ>Ô>€EØ
‡J‚JˆuÑÔÐØ€Mr"   c                  óÒ   — e Zd ZdZ e eg d¢¦  «        ¦  «        dd„¦   «         Z e edd	g¦  «        ¦  «        dd„¦   «         Z e edd	g¦  «        ¦  «        dd„¦   «         ZdS )ÚLogfileTestsz)
    Tests for the --logfile option.
    )zdir-azdir-bzdir-c/dir-dÚworkingDirectoryr   r   r#   c                óÌ   — t          d|g¦  «        }t          |¦  «                             |d         ¦  «        }t          |t	          t          d¦  «        ¦  «        ¦  «         dS )zƒ
        If no value is given for the option then logs are written to a log
        file constructed from a default value.
        ú--temp-directoryÚlogfiler%   N©ÚrunFromArgumentsr   ÚpreauthChildr   r   r   )Úselfr<   r/   ÚlogPaths       r!   Útest_defaultzLogfileTests.test_defaultP   s_   € õ "Ð#5Ð7GÐ"HÑIÔIˆÝ%Ð&6Ñ7Ô7×DÒDÀVÈIÔEVÑWÔWˆÝ�G�\­/¸+Ñ*FÔ*FÑGÔGÑHÔHÐHÐHÐHr"   zsomelog.txtzsomedir/somelog.txtr?   c                óÌ   — t          d|g¦  «        }t          |d         ¦  «                             |¦  «        }t          |t	          t          d¦  «        ¦  «        ¦  «         dS )z½
        If the value given for the option is a relative path then it is
        interpreted relative to trial's own temporary working directory and
        logs are written there.
        ú	--logfileútemp-directoryr%   Nr@   )rC   r?   r/   rD   s       r!   Útest_relativePathzLogfileTests.test_relativePathb   s]   € õ " ;°Ð"8Ñ9Ô9ˆÝ% fÐ-=Ô&>Ñ?Ô?×LÒLÈWÑUÔUˆÝ�G�\­/¸+Ñ*FÔ*FÑGÔGÑHÔHÐHÐHÐHr"   c                óÎ   — t          d¦  «                             |¦  «        }t          d|j        g¦  «         |}t	          |t          t          d¦  «        ¦  «        ¦  «         dS )z�
        If the value given for the option is an absolute path then it is
        interpreted absolutely and logs are written there.
        ú.rG   r%   N)r   rB   rA   Úpathr   r   r   )rC   r?   rD   ÚiPaths       r!   Útest_absolutePathzLogfileTests.test_absolutePatht   s]   € õ" ˜3‘-”-×,Ò,¨WÑ5Ô5ˆÝ˜+ w¤|Ð4Ñ5Ô5Ð5Ø"ˆÝ�E�<­¸Ñ(DÔ(DÑEÔEÑFÔFÐFÐFÐFr"   N)r<   r   r   r#   )r?   r   r   r#   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r	   rE   rI   rN   r'   r"   r!   r;   r;   K   s  € € € € € ðð ð €UØˆðð ð ñ	
ô 	
ñô ðIð Ið Iñô ðIð €UØˆàØ%ðñ	
ô 	
ñô ðIð Ið Iñô ðIð €UØˆàØ%ðñ	
ô 	
ñô ðGð Gð Gñô ðGð Gð Gr"   r;   c                  óB   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd	„Zdd
„Z	dS )ÚForceGarbageCollectionTestsz*
    Tests for the --force-gc option.
    r   r#   c                óð   — t          j        ¦   «         | _        g | _        |                      t
          d| j        ¦  «         t                               | j	        ¦  «        }t          ||g¦  «        | _        d S )NÚcollect)r   r-   r/   ÚlogÚpatchÚgcrV   r4   r5   Ú
simpleTestr   Útest)rC   r[   s     r!   ÚsetUpz!ForceGarbageCollectionTests.setUp�   sZ   € Ý”m‘o”oˆŒØ ˆŒØ�
Š
•2�y $¤,Ñ/Ô/Ð/Ý×&Ò& t¤Ñ7Ô7ˆÝ˜t T˜lÑ+Ô+ˆŒ	ˆ	ˆ	r"   c                ó:   — | j                              d¦  «         dS )zD
        A simple test method that records that it was run.
        r[   N©rW   Úappend©rC   s    r!   rZ   z&ForceGarbageCollectionTests.simpleTest—   s   € ð 	Œ�Š˜ÑÔÐÐÐr"   c                ó:   — | j                              d¦  «         dS )zI
        A replacement for gc.collect that logs calls to itself.
        rV   Nr^   r`   s    r!   rV   z#ForceGarbageCollectionTests.collect�   s   € ð 	Œ�Š˜	Ñ"Ô"Ð"Ð"Ð"r"   r   c                ó^   — t          j        | j        ¦  «        }t          ¦   «         |_        |S )zN
        Return a L{TrialRunner} object that is safe to use in tests.
        )r   r2   r/   r   r3   ©rC   r7   s     r!   Ú
makeRunnerz&ForceGarbageCollectionTests.makeRunner£   s&   € õ Ô" 4¤;Ñ/Ô/ˆÝ ™
œ
ˆŒØˆr"   c                óâ   — d| j         d<   | j                              ¦   «          |                      ¦   «         }|                     | j        ¦  «         |                      | j        g d¢¦  «         dS )z‹
        Passing the --force-gc option to the trial script forces the garbage
        collector to run before and after each test.
        Tzforce-gc)rV   r[   rV   rV   r[   rV   N©r/   ÚpostOptionsrd   r6   r[   ÚassertEqualrW   rc   s     r!   Útest_forceGcz(ForceGarbageCollectionTests.test_forceGc«   sw   € ð
 #'ˆŒ�JÑØŒ×ÒÑ!Ô!Ð!Ø—’Ñ"Ô"ˆØ�
Š
�4”9ÑÔÐØ×ÒØŒHÐRÐRÐRñ	
ô 	
ð 	
ð 	
ð 	
r"   c                óÎ   — | j                              ¦   «          |                      ¦   «         }|                     | j        ¦  «         |                      | j        ddg¦  «         dS )z>
        By default, no garbage collection is forced.
        r[   Nrf   rc   s     r!   Útest_unforceGcz*ForceGarbageCollectionTests.test_unforceGc¸   s^   € ð 	Œ×ÒÑ!Ô!Ð!Ø—’Ñ"Ô"ˆØ�
Š
�4”9ÑÔÐØ×Ò˜œ F¨FÐ#3Ñ4Ô4Ð4Ð4Ð4r"   N©r   r#   )r   r   )
rO   rP   rQ   rR   r\   rZ   rV   rd   ri   rk   r'   r"   r!   rT   rT   ‹   s–   € € € € € ðð ð,ð ,ð ,ð ,ð ð  ð  ð  ð#ð #ð #ð #ðð ð ð ð
ð 
ð 
ð 
ð5ð 5ð 5ð 5ð 5ð 5r"   rT   c                  ó*   — e Zd ZdZdd„Zdd„Zdd„ZdS )	ÚSuiteUsedTestsz?
    Check the category of tests suite used by the loader.
    r   r#   c                ó6   — t          j        ¦   «         | _        dS )z6
        Create a trial configuration object.
        N©r   r-   r/   r`   s    r!   r\   zSuiteUsedTests.setUpÇ   s   € õ ”m‘o”oˆŒˆˆr"   c                óx   — t          j        | j        ¦  «        }|                      |j        t
          ¦  «         dS )zK
        By default, the loader should use L{DestructiveTestSuite}
        N)r   Ú
_getLoaderr/   rh   ÚsuiteFactoryr   ©rC   Úloaders     r!   Útest_defaultSuitez SuiteUsedTests.test_defaultSuiteÍ   s6   € õ Ô! $¤+Ñ.Ô.ˆØ×Ò˜Ô,Õ.BÑCÔCÐCÐCÐCr"   c                óŒ   — d| j         d<   t          j        | j         ¦  «        }|                      |j        t
          ¦  «         dS )zw
        The C{until-failure} configuration uses the L{TestSuite} to keep
        instances alive across runs.
        Tzuntil-failureN)r/   r   rr   rh   rs   r   rt   s     r!   Útest_untilFailureSuitez%SuiteUsedTests.test_untilFailureSuiteÔ   sA   € ð
 (,ˆŒ�OÑ$ÝÔ! $¤+Ñ.Ô.ˆØ×Ò˜Ô,­iÑ8Ô8Ð8Ð8Ð8r"   Nrl   )rO   rP   rQ   rR   r\   rv   rx   r'   r"   r!   rn   rn   Â   s^   € € € € € ðð ð&ð &ð &ð &ðDð Dð Dð Dð9ð 9ð 9ð 9ð 9ð 9r"   rn   c                  óÞ   — e Zd Zd"d„Zd"d„Zd"d„Zd#d
„Zd"d„Zd"d„Zd"d„Z	d"d„Z
d"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d„Zd"d „Zd!S )$ÚTestModuleTestsr   r#   c                ó6   — t          j        ¦   «         | _        d S ©Nrp   r`   s    r!   r\   zTestModuleTests.setUpß   ó   € Ý”m‘o”oˆŒˆˆr"   c                ó   — d | _         d S r|   )r/   r`   s    r!   ÚtearDownzTestModuleTests.tearDownâ   s   € ØˆŒˆˆr"   c                ór   — |                       t          | ¦  «        |                      ¦   «         g¦  «         dS )zq
        Check that the testNames helper method accurately collects the
        names of tests in suite.
        N)rh   r   Úidr`   s    r!   Útest_testNameszTestModuleTests.test_testNameså   s0   € ð
 	×Ò� 4™œ¨4¯7ª7©9¬9¨+Ñ6Ô6Ð6Ð6Ð6r"   Útest1r   Únamesú	list[str]c                ó  — t          ¦   «         }t          |¦  «        }t          t          t          |j        |¦  «        ¦  «        ¦  «        }|                     ¦   «          |                     ¦   «          |                      ||¦  «         d S r|   )r   r   r   ÚmapÚ
loadByNameÚsortrh   )rC   rƒ   r„   ru   Únames1Únames2s         r!   ÚassertSuitesEqualz!TestModuleTests.assertSuitesEqualì   sp   € Ý‘”ˆÝ˜5Ñ!Ô!ˆÝ�9¥S¨Ô):¸EÑ%BÔ%BÑCÔCÑDÔDˆØ�Š‰ŒˆØ�Š‰ŒˆØ×Ò˜ Ñ(Ô(Ð(Ð(Ð(r"   c                ób   — |                       dt          | j        d         ¦  «        ¦  «         d S )Nr   Útests)rh   Úlenr/   r`   s    r!   Útest_baseStatezTestModuleTests.test_baseStateô   s-   € Ø×Ò˜�C ¤¨GÔ 4Ñ5Ô5Ñ6Ô6Ð6Ð6Ð6r"   c                ó°   — | j                              t          d¦  «        ¦  «         |                      t	          j        | j         ¦  «        dg¦  «         dS )zŒ
        Check that --testmodule loads a suite which contains the tests
        referred to in test-case-name inside its parameter.
        úmoduletest.pyútwisted.trial.test.test_logN©r/   Úopt_testmoduler   rŒ   r   Ú	_getSuiter`   s    r!   Útest_testmoduleOnModulez'TestModuleTests.test_testmoduleOnModule÷   sY   € ð
 	Œ×"Ò"¥7¨?Ñ#;Ô#;Ñ<Ô<Ð<Ø×ÒÝŒO˜DœKÑ(Ô(Ð+HÐ*Iñ	
ô 	
ð 	
ð 	
ð 	
r"   c                óþ   — | j                              t          d¦  «        ¦  «         | j                              t          d¦  «        ¦  «         |                      t	          j        | j         ¦  «        dg¦  «         dS )z�
        When the same module is specified with two --testmodule flags, it
        should only appear once in the suite.
        r’   r“   Nr”   r`   s    r!   Útest_testmoduleTwicez$TestModuleTests.test_testmoduleTwice  sw   € ð
 	Œ×"Ò"¥7¨?Ñ#;Ô#;Ñ<Ô<Ð<ØŒ×"Ò"¥7¨?Ñ#;Ô#;Ñ<Ô<Ð<Ø×ÒÝŒO˜DœKÑ(Ô(Ð+HÐ*Iñ	
ô 	
ð 	
ð 	
ð 	
r"   c                óþ   — | j                              t          d¦  «        ¦  «         | j                              t          d¦  «        ¦  «         |                      t	          j        | j         ¦  «        dg¦  «         dS )z³
        If --testmodule is specified twice, once for module A and once for
        a module which refers to module A, then make sure module A is only
        added once.
        r’   ztest_log.pyr“   Nr”   r`   s    r!   Ú test_testmoduleOnSourceAndTargetz0TestModuleTests.test_testmoduleOnSourceAndTarget  sw   € ð 	Œ×"Ò"¥7¨?Ñ#;Ô#;Ñ<Ô<Ð<ØŒ×"Ò"¥7¨=Ñ#9Ô#9Ñ:Ô:Ð:Ø×ÒÝŒO˜DœKÑ(Ô(Ð+HÐ*Iñ	
ô 	
ð 	
ð 	
ð 	
r"   c                ó°   — | j                              t          d¦  «        ¦  «         |                      t	          j        | j         ¦  «        dg¦  «         dS )z—
        When given a module that refers to *itself* in the test-case-name
        variable, check that --testmodule only adds the tests once.
        zmoduleself.pyztwisted.trial.test.moduleselfNr”   r`   s    r!   Útest_testmoduleOnSelfModulez+TestModuleTests.test_testmoduleOnSelfModule  sY   € ð
 	Œ×"Ò"¥7¨?Ñ#;Ô#;Ñ<Ô<Ð<Ø×ÒÝŒO˜DœKÑ(Ô(Ð+JÐ*Kñ	
ô 	
ð 	
ð 	
ð 	
r"   c                ó²   — | j                              t          d¦  «        ¦  «         |                      t	          j        | j         ¦  «        ddg¦  «         dS )zm
        Check that --testmodule loads tests referred to in test-case-name
        buffer variables.
        úscripttest.pyr“   útwisted.trial.test.test_runnerNr”   r`   s    r!   Útest_testmoduleOnScriptz'TestModuleTests.test_testmoduleOnScript"  s\   € ð
 	Œ×"Ò"¥7¨?Ñ#;Ô#;Ñ<Ô<Ð<Ø×ÒÝŒO˜DœKÑ(Ô(Ø*Ð,LÐMñ	
ô 	
ð 	
ð 	
ð 	
r"   c                ó|  — t          ¦   «         }t          j        |c}t          _        d}	 | j                             |¦  «         |                      dt          | j        d         ¦  «        ¦  «         |                      d|›d�|                     ¦   «         ¦  «         |t          _        dS # |t          _        w xY w)zz
        Check that --testmodule displays a meaningful error message when
        passed a non-existent filename.
        ztest_thisbetternoteverexist.pyr   rŽ   úFile ú doesn't exist
N©r   ÚsysÚstderrr/   r•   rh   r�   Úgetvalue)rC   Úbuffyr§   r   s       r!   Ú test_testmoduleOnNonexistentFilez0TestModuleTests.test_testmoduleOnNonexistentFile-  s¬   € õ
 ‘
”
ˆÝ œZ¨Ðˆ•”
Ø3ˆð	 ØŒK×&Ò& xÑ0Ô0Ð0Ø×Ò˜Q¥ D¤K°Ô$8Ñ 9Ô 9Ñ:Ô:Ð:Ø×ÒÐA XÐAÐAÐAÀ5Ç>Â>ÑCSÔCSÑTÔTÐTà�CŒJˆJˆJø˜�CŒJÐÐÐÐó   «A4B- Â-B;c                ó°   — | j                              t          d¦  «        ¦  «         |                      dt	          | j         d         ¦  «        ¦  «         dS )z„
        Check that --testmodule adds no tests to the suite for modules
        which lack test-case-name buffer variables.
        ú	novars.pyr   rŽ   N)r/   r•   r   rh   r�   r`   s    r!   Útest_testmoduleOnEmptyVarsz*TestModuleTests.test_testmoduleOnEmptyVars<  sM   € ð
 	Œ×"Ò"¥7¨;Ñ#7Ô#7Ñ8Ô8Ð8Ø×Ò˜�C ¤¨GÔ 4Ñ5Ô5Ñ6Ô6Ð6Ð6Ð6r"   c                ó|  — t          ¦   «         }t          j        |c}t          _        d}	 | j                             |¦  «         |                      dt          | j        d         ¦  «        ¦  «         |                      d|›d�|                     ¦   «         ¦  «         |t          _        dS # |t          _        w xY w)z�
        Check that --testmodule does *not* support module names as arguments
        and that it displays a meaningful error message.
        ztwisted.trial.test.test_scriptr   rŽ   r£   r¤   Nr¥   )rC   r©   r§   Ú
moduleNames       r!   Útest_testmoduleOnModuleNamez+TestModuleTests.test_testmoduleOnModuleNameD  s¬   € õ
 ‘
”
ˆÝ œZ¨Ðˆ•”
Ø5ˆ
ð	 ØŒK×&Ò& zÑ2Ô2Ð2Ø×Ò˜Q¥ D¤K°Ô$8Ñ 9Ô 9Ñ:Ô:Ð:Ø×ÒÐC ZÐCÐCÐCÀUÇ^Â^ÑEUÔEUÑVÔVÐVà�CŒJˆJˆJø˜�CŒJÐÐÐÐr«   c                ób   — d}t          j        |¦  «        }|                      ddi|¦  «         d S )Nz5-*- test-case-name: twisted.trial.test.test_tests -*-útest-case-nameútwisted.trial.test.test_tests©r   Ú_parseLocalVariablesrh   ©rC   ÚdeclarationÚ	localVarss      r!   Útest_parseLocalVariablez'TestModuleTests.test_parseLocalVariableS  s:   € ØMˆÝÔ.¨{Ñ;Ô;ˆ	Ø×ÒÐ*Ð,KÐLÈiÑXÔXÐXÐXÐXr"   c                ób   — d}t          j        |¦  «        }|                      ddi|¦  «         d S )Nz6-*- test-case-name: twisted.trial.test.test_tests; -*-r³   r´   rµ   r·   s      r!   Útest_trailingSemicolonz&TestModuleTests.test_trailingSemicolonX  s:   € ØNˆÝÔ.¨{Ñ;Ô;ˆ	Ø×ÒÐ*Ð,KÐLÈiÑXÔXÐXÐXÐXr"   c                ód   — d}t          j        |¦  «        }|                      dddœ|¦  «         d S )Nz?-*- test-case-name: twisted.trial.test.test_tests; foo: bar -*-r´   Úbar)r³   Úfoorµ   r·   s      r!   Útest_parseLocalVariablesz(TestModuleTests.test_parseLocalVariables]  sK   € àPð 	õ Ô.¨{Ñ;Ô;ˆ	Ø×ÒØ>ÀuÐMÐMÈyñ	
ô 	
ð 	
ð 	
ð 	
r"   c                ób   — d}t          j        |¦  «        }|                      ddi|¦  «         d S )Nz:## -*- test-case-name: twisted.trial.test.test_tests -*- #r³   r´   rµ   r·   s      r!   Útest_surroundingGuffz$TestModuleTests.test_surroundingGufff  s:   € ØUˆÝÔ.¨{Ñ;Ô;ˆ	Ø×ÒÐ*Ð,KÐLÈiÑXÔXÐXÐXÐXr"   c                óR   — |                       t          t          j        d¦  «         d S ©Nr¿   ©ÚassertRaisesÚ
ValueErrorr   r¶   r`   s    r!   Útest_invalidLinez TestModuleTests.test_invalidLinek  s#   € Ø×Ò�*¥eÔ&@À%ÑHÔHÐHÐHÐHr"   c                óê   — |                       t          t          j        d¦  «         |                       t          t          j        d¦  «         |                       t          t          j        d¦  «         d S )Nz-*- foo -*-z-*- foo: bar; qux -*-z-*- foo: bar: baz; qux: qax -*-rÅ   r`   s    r!   Útest_invalidDeclarationz'TestModuleTests.test_invalidDeclarationn  so   € Ø×Ò�*¥eÔ&@À-ÑPÔPÐPØ×ÒÝ�Ô2Ð4Kñ	
ô 	
ð 	
ð 	×ÒÝ�Ô2Ð4Uñ	
ô 	
ð 	
ð 	
ð 	
r"   c                óx   — t          j        t          d¦  «        ¦  «        }|                      ddi|¦  «         d S )Nr’   r³   r“   ©r   ÚloadLocalVariablesr   rh   ©rC   r¹   s     r!   Útest_variablesFromFilez&TestModuleTests.test_variablesFromFilew  s=   € ÝÔ,­W°_Ñ-EÔ-EÑFÔFˆ	Ø×ÒÐ*Ð,IÐJÈIÑVÔVÐVÐVÐVr"   c                ót   — t          j        t          d¦  «        ¦  «        }|                      i |¦  «         d S )Nr­   rÌ   rÎ   s     r!   Útest_noVariablesInFilez&TestModuleTests.test_noVariablesInFile{  s6   € ÝÔ,­W°[Ñ-AÔ-AÑBÔBˆ	Ø×Ò˜˜YÑ'Ô'Ð'Ð'Ð'r"   c                óx   — t          j        t          d¦  «        ¦  «        }|                      ddi|¦  «         d S )NrŸ   r³   z:twisted.trial.test.test_log,twisted.trial.test.test_runnerrÌ   rÎ   s     r!   Útest_variablesFromScriptz(TestModuleTests.test_variablesFromScript  sL   € ÝÔ,­W°_Ñ-EÔ-EÑFÔFˆ	Ø×Òà ØSðð
 ñ	
ô 	
ð 	
ð 	
ð 	
r"   c                óv   — t          j        t          d¦  «        ¦  «        }|                      |dg¦  «         d S )Nr’   r“   )r   ÚgetTestModulesr   rh   ©rC   Úmoduless     r!   Útest_getTestModulesz#TestModuleTests.test_getTestModulesŠ  s:   € ÝÔ&¥w¨Ñ'?Ô'?Ñ@Ô@ˆØ×Ò˜Ð#@Ð"AÑBÔBÐBÐBÐBr"   c                óŽ   — t          j        t          d¦  «        ¦  «        }|                      t	          |¦  «        d¦  «         d S )Nr­   r   )r   rÕ   r   rh   r�   rÖ   s     r!   Útest_getTestModules_noVarsz*TestModuleTests.test_getTestModules_noVarsŽ  s<   € ÝÔ&¥w¨{Ñ';Ô';Ñ<Ô<ˆØ×Ò�˜W™œ qÑ)Ô)Ð)Ð)Ð)r"   c                ó’   — t          j        t          d¦  «        ¦  «        }|                      t	          |¦  «        ddh¦  «         d S )NrŸ   r“   r    )r   rÕ   r   rh   ÚsetrÖ   s     r!   Útest_getTestModules_multiplez,TestModuleTests.test_getTestModules_multiple’  sN   € ÝÔ&¥w¨Ñ'?Ô'?Ñ@Ô@ˆØ×ÒÝ�‰LŒLØ*Ð,LÐMñ	
ô 	
ð 	
ð 	
ð 	
r"   c                ó   — dD ]-}|                       t          j        |¦  «        |›d�¦  «         Œ.dt          d¦  «        t          d¦  «        fD ]-}|                      t          j        |¦  «        |›d�¦  «         Œ.d S )N)ztest_script.pyz!twisted/trial/test/test_script.pyz should be a test filez twisted/trial/test/moduletest.pyrŸ   ztest_foo.batz should *not* be a test file)Ú
assertTruer   Ú
isTestFiler   ÚassertFalse)rC   r   s     r!   Útest_looksLikeTestModulez(TestModuleTests.test_looksLikeTestModule™  sµ   € ØOð 	ð 	ˆHØ�OŠOÝÔ  Ñ*Ô*ØÐ5Ð5Ð5ñô ð ð ð
 /Ý�OÑ$Ô$Ý�NÑ#Ô#ð
ð 	ð 	ˆHð
 ×ÒÝÔ  Ñ*Ô*ØÐ;Ð;Ð;ñô ð ð ð	ð 	r"   Nrl   )rƒ   r   r„   r…   r   r#   )rO   rP   rQ   r\   r   r‚   rŒ   r�   r—   r™   r›   r�   r¡   rª   r®   r±   rº   r¼   rÀ   rÂ   rÈ   rÊ   rÏ   rÑ   rÓ   rØ   rÚ   rÝ   râ   r'   r"   r!   rz   rz   Þ   s4  € € € € € ð&ð &ð &ð &ðð ð ð ð7ð 7ð 7ð 7ð)ð )ð )ð )ð7ð 7ð 7ð 7ð
ð 
ð 
ð 
ð	
ð 	
ð 	
ð 	
ð

ð 

ð 

ð 

ð
ð 
ð 
ð 
ð	
ð 	
ð 	
ð 	
ð ð  ð  ð  ð7ð 7ð 7ð 7ð ð  ð  ð  ðYð Yð Yð Yð
Yð Yð Yð Yð

ð 
ð 
ð 
ðYð Yð Yð Yð
Ið Ið Ið Ið
ð 
ð 
ð 
ðWð Wð Wð Wð(ð (ð (ð (ð	
ð 	
ð 	
ð 	
ðCð Cð Cð Cð*ð *ð *ð *ð
ð 
ð 
ð 
ðð ð ð ð ð r"   rz   c                  óJ   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd	„Zdd
„Z	dd„Z
dS )ÚWithoutModuleTestsz*
    Test the C{without-module} flag.
    r   r#   c                ór   — t          j        ¦   «         | _        t          t          j        ¦  «        | _        dS )zl
        Create a L{trial.Options} object to be used in the tests, and save
        C{sys.modules}.
        N)r   r-   r/   Údictr¦   r×   ÚsavedModulesr`   s    r!   r\   zWithoutModuleTests.setUp¯  s)   € õ
 ”m‘o”oˆŒÝ ¥¤Ñ-Ô-ˆÔÐÐr"   c                ó˜   — dD ]F}|| j         v r| j         |         t          j        |<   Œ&t          j                             |d¦  «         ŒGdS )z)
        Restore C{sys.modules}.
        )ÚimaplibÚsmtplibN)rç   r¦   r×   Úpop)rC   Úmodules     r!   r   zWithoutModuleTests.tearDown·  s[   € ð -ð 	.ð 	.ˆFØ˜Ô*Ð*Ð*Ø&*Ô&7¸Ô&?•”˜FÑ#Ð#å”—’ ¨Ñ-Ô-Ð-Ð-ð		.ð 	.r"   Úobjectc                ó   — ddl }|S )zE
        Try to import the C{smtplib} module, and return it.
        r   N)rê   )rC   rê   s     r!   Ú
_checkSMTPzWithoutModuleTests._checkSMTPÁ  ó   € ð 	ˆˆˆàˆr"   c                ó   — ddl }|S )zE
        Try to import the C{imaplib} module, and return it.
        r   N)ré   )rC   ré   s     r!   Ú
_checkIMAPzWithoutModuleTests._checkIMAPÉ  rð   r"   c                óü   — | j                              ddg¦  «         |                      t          | j        ¦  «         t
          j        d= |                      |                      ¦   «         t          j	        ¦  «         dS )zT
        Check that after disabling a module, it can't be imported anymore.
        ú--without-modulerê   N)
r/   r.   rÆ   ÚImportErrorrï   r¦   r×   ÚassertIsInstanceÚtypesÚ
ModuleTyper`   s    r!   Útest_disableOneModulez(WithoutModuleTests.test_disableOneModuleÑ  sk   € ð 	Œ× Ò Ð"4°iÐ!@ÑAÔAÐAØ×Ò�+ t¤Ñ7Ô7Ð7åŒK˜	Ð"à×Ò˜dŸošoÑ/Ô/µÔ1AÑBÔBÐBÐBÐBr"   c                óº  — | j                              ddg¦  «         |                      t          | j        ¦  «         |                      t          | j        ¦  «         t          j        d= t          j        d= |                      |                      ¦   «         t          j
        ¦  «         |                      |                      ¦   «         t          j
        ¦  «         dS )zE
        Check that several modules can be disabled at once.
        rô   zsmtplib,imaplibrê   ré   N)r/   r.   rÆ   rõ   rï   rò   r¦   r×   rö   r÷   rø   r`   s    r!   Útest_disableMultipleModulesz.WithoutModuleTests.test_disableMultipleModulesÜ  s±   € ð 	Œ× Ò Ð"4Ð6GÐ!HÑIÔIÐIØ×Ò�+ t¤Ñ7Ô7Ð7Ø×Ò�+ t¤Ñ7Ô7Ð7åŒK˜	Ð"ÝŒK˜	Ð"à×Ò˜dŸošoÑ/Ô/µÔ1AÑBÔBÐBØ×Ò˜dŸošoÑ/Ô/µÔ1AÑBÔBÐBÐBÐBr"   c                ó  — |                       |                      ¦   «         t          j        ¦  «         |                      t
          dt          j        | j        j	        ddg¦  «         |  
                    t          | j        ¦  «         dS )zP
        Disabling an already imported module should produce a warning.
        z4Module 'smtplib' already imported, disabling anyway.rô   rê   N)rö   rï   r÷   rø   ÚassertWarnsÚRuntimeWarningr   r    r/   r.   rÆ   rõ   r`   s    r!   Ú!test_disableAlreadyImportedModulez4WithoutModuleTests.test_disableAlreadyImportedModuleê  sz   € ð 	×Ò˜dŸošoÑ/Ô/µÔ1AÑBÔBÐBØ×ÒÝØBÝŒNØŒKÔ$Ø Ð+ñ	
ô 	
ð 	
ð 	×Ò�+ t¤Ñ7Ô7Ð7Ð7Ð7r"   Nrl   )r   rí   )rO   rP   rQ   rR   r\   r   rï   rò   rù   rû   rÿ   r'   r"   r!   rä   rä   ª  s²   € € € € € ðð ð.ð .ð .ð .ð.ð .ð .ð .ðð ð ð ðð ð ð ð	Cð 	Cð 	Cð 	CðCð Cð Cð Cð8ð 8ð 8ð 8ð 8ð 8r"   rä   c                  óP   — e Zd ZdZ eedd¦  «        €dZdd„Zdd„Zdd	„Z	dd
„Z
dS )ÚCoverageTestsz+
    Tests for the I{coverage} option.
    ÚgettraceNz;Cannot test trace hook installation without inspection API.r   r#   c                óh   — |                       t          j        t          j        ¦   «         ¦  «         dS )zf
        Arrange for the current trace hook to be restored when the
        test is complete.
        N)Ú
addCleanupr¦   Úsettracer  r`   s    r!   r\   zCoverageTests.setUp  s&   € ð
 	�Š�œ¥c¤l¡n¤nÑ5Ô5Ð5Ð5Ð5r"   c                óÌ   — t          j        ¦   «         }|                     dg¦  «         |j        €J ‚|                      t          j        ¦   «         |j        j        ¦  «         dS )z}
        L{trial.Options} handles C{"--coverage"} by installing a trace
        hook to record coverage information.
        z
--coverageN)r   r-   r.   Útracerrh   r¦   r  Úglobaltrace©rC   Úoptionss     r!   Útest_tracerInstalledz"CoverageTests.test_tracerInstalled  sf   € õ
 ”-‘/”/ˆØ×Ò˜l˜^Ñ,Ô,Ð,ØŒ~Ð)Ð)Ð)Ø×ÒÝŒL‰NŒNàŒNÔ&ñ	
ô 	
ð 	
ð 	
ð 	
r"   c                óÌ   — t          j        ¦   «         }|                      |                     ¦   «         t	          d¦  «                             |d         dg¦  «        ¦  «         dS )z 
        L{trial.Options.coverdir} returns a L{FilePath} based on the default
        for the I{temp-directory} option if that option is not specified.
        rK   rH   ÚcoverageN)r   r-   rh   Úcoverdirr   Ú
descendantr	  s     r!   Útest_coverdirDefaultz"CoverageTests.test_coverdirDefault  sb   € õ
 ”-‘/”/ˆØ×ÒØ×ÒÑÔÝ�S‰MŒM×$Ò$ gÐ.>Ô&?ÀÐ%LÑMÔMñ	
ô 	
ð 	
ð 	
ð 	
r"   c                ó  — |                       ¦   «         }t          j        ¦   «         }|                     d|g¦  «         |                      |                     ¦   «         t          |¦  «                             d¦  «        ¦  «         dS )z‹
        If a value is specified for the I{temp-directory} option,
        L{trial.Options.coverdir} returns a child of that path.
        r>   r  N)Úmktempr   r-   r.   rh   r  r   Úchild)rC   rL   r
  s      r!   Útest_coverdirOverriddenz%CoverageTests.test_coverdirOverridden!  sr   € ð
 �{Š{‰}Œ}ˆÝ”-‘/”/ˆØ×ÒÐ0°$Ð7Ñ8Ô8Ð8Ø×Ò˜×)Ò)Ñ+Ô+­X°d©^¬^×-AÒ-AÀ*Ñ-MÔ-MÑNÔNÐNÐNÐNr"   rl   )rO   rP   rQ   rR   Úgetattrr¦   Úskipr\   r  r  r  r'   r"   r!   r  r  ù  s�   € € € € € ðð ð €wˆs�J Ñ%Ô%Ð-ØLˆð6ð 6ð 6ð 6ð
ð 
ð 
ð 
ð	
ð 	
ð 	
ð 	
ðOð Oð Oð Oð Oð Or"   r  c                  óB   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd„Zdd	„Z	d
S )ÚOptionsTestsz%
    Tests for L{trial.Options}.
    r   r#   c                ó6   — t          j        ¦   «         | _        dS )zE
        Build an L{Options} object to be used in the tests.
        N©r   r-   r
  r`   s    r!   r\   zOptionsTests.setUp1  s   € õ ”}‘”ˆŒˆˆr"   c                ó¼  — |                       t          j        t          j        ¦   «         ¦  «         t	          j        ¦   «         r|                       t          j        ¦  «         | j                             g d¢¦  «         | j         	                    ¦   «         }|  
                    d|¦  «         |                     d¦  «         |                      ddg|¦  «         dS )z¹
        C{_getWorkerArguments} discards options like C{random} as they only
        matter in the manager, and forwards options like C{recursionlimit} or
        C{disablegc}.
        )ú--recursionlimitÚ2000ú--randomÚ4ú--disablegcr   r  r  N)r  r¦   ÚsetrecursionlimitÚgetrecursionlimitrY   Ú	isenabledÚenabler
  r.   Ú_getWorkerArgumentsÚassertInÚremoverh   )rC   Úargss     r!   Útest_getWorkerArgumentsz$OptionsTests.test_getWorkerArguments7  sÆ   € ð 	�Š�Ô-­sÔ/DÑ/FÔ/FÑGÔGÐGÝŒ<‰>Œ>ð 	'Ø�OŠO�BœIÑ&Ô&Ð&àŒ×!Ò!ØHÐHÐHñ	
ô 	
ð 	
ð Œ|×/Ò/Ñ1Ô1ˆØ�Š�m TÑ*Ô*Ð*Ø�Š�MÑ"Ô"Ð"Ø×ÒÐ,¨fÐ5°tÑ<Ô<Ð<Ð<Ð<r"   c                óœ   — |                       t          | j        j        g d¢¦  «        }|                      dt          |¦  «        ¦  «         dS )zÁ
        C{parseOptions} raises a C{UsageError} when C{--debug} is passed along
        C{--jobs} as it's not supported yet.

        @see: U{http://twistedmatrix.com/trac/ticket/5825}
        )ú--jobsr  ú--debugz+You can't specify --debug when using --jobsN©rÆ   r   r
  r.   rh   r   ©rC   Úerrors     r!   Útest_jobsConflictWithDebugz'OptionsTests.test_jobsConflictWithDebugI  sQ   € ð ×!Ò!Ý˜œÔ1Ð3MÐ3MÐ3Mñ
ô 
ˆð 	×ÒÐFÍÈEÉ
Ì
ÑSÔSÐSÐSÐSr"   c                óœ   — |                       t          | j        j        g d¢¦  «        }|                      dt          |¦  «        ¦  «         dS )zÃ
        C{parseOptions} raises a C{UsageError} when C{--profile} is passed
        along C{--jobs} as it's not supported yet.

        @see: U{http://twistedmatrix.com/trac/ticket/5827}
        )r+  r  z	--profilez-You can't specify --profile when using --jobsNr-  r.  s     r!   Útest_jobsConflictWithProfilez)OptionsTests.test_jobsConflictWithProfileU  sQ   € ð ×!Ò!Ý˜œÔ1Ð3OÐ3OÐ3Oñ
ô 
ˆð 	×ÒÐHÍ#ÈeÉ*Ì*ÑUÔUÐUÐUÐUr"   c                óœ   — |                       t          | j        j        g d¢¦  «        }|                      dt          |¦  «        ¦  «         dS )zÍ
        C{parseOptions} raises a C{UsageError} when C{--debug-stacktraces} is
        passed along C{--jobs} as it's not supported yet.

        @see: U{http://twistedmatrix.com/trac/ticket/5826}
        )r+  r  z--debug-stacktracesz7You can't specify --debug-stacktraces when using --jobsNr-  r.  s     r!   Ú%test_jobsConflictWithDebugStackTracesz2OptionsTests.test_jobsConflictWithDebugStackTracesa  s\   € ð ×!Ò!ÝØŒLÔ%Ø2Ð2Ð2ñ
ô 
ˆð
 	×ÒØEÅsÈ5ÁzÄzñ	
ô 	
ð 	
ð 	
ð 	
r"   c                óœ   — |                       t          | j        j        g d¢¦  «        }|                      dt          |¦  «        ¦  «         dS )zr
        C{parseOptions} raises a C{UsageError} when C{--order} is passed along
        with C{--random}.
        )ú--orderÚalphabeticalr  Ú1234z-You can't specify --random when using --orderNr-  r.  s     r!   Útest_orderConflictWithRandomz)OptionsTests.test_orderConflictWithRandomq  sR   € ð
 ×!Ò!ÝØŒLÔ%Ø;Ð;Ð;ñ
ô 
ˆð
 	×ÒÐHÍ#ÈeÉ*Ì*ÑUÔUÐUÐUÐUr"   Nrl   )
rO   rP   rQ   rR   r\   r)  r0  r2  r4  r9  r'   r"   r!   r  r  ,  s¤   € € € € € ðð ð'ð 'ð 'ð 'ð=ð =ð =ð =ð$
Tð 
Tð 
Tð 
Tð
Vð 
Vð 
Vð 
Vð
ð 
ð 
ð 
ð 
Vð 
Vð 
Vð 
Vð 
Vð 
Vr"   r  c                  ó:   — e Zd ZdZd
d„Zd
d„Zd
d„Zd
d„Zd
d„Zd	S )ÚMakeRunnerTestsz.
    Tests for the L{_makeRunner} helper.
    r   r#   c                ó6   — t          j        ¦   «         | _        d S r|   r  r`   s    r!   r\   zMakeRunnerTests.setUpƒ  s   € Ý”}‘”ˆŒˆˆr"   c                óB  — | j                              g d¢¦  «         t          j        | j         ¦  «        }t	          |t
          ¦  «        sJ ‚|                      |t
          ¦  «         |                      d|j        ¦  «         |                      dg|j	        ¦  «         dS )zÝ
        L{_makeRunner} returns a L{DistTrialRunner} instance when the C{--jobs}
        option is passed.  The L{DistTrialRunner} knows how many workers to
        run and the C{workerArguments} to pass to them.
        )r+  r  ú
--force-gcé   r>  N)
r
  r.   r   r2   Ú
isinstancer   rö   rh   Ú_maxWorkersÚ_workerArgumentsrc   s     r!   Ú	test_jobszMakeRunnerTests.test_jobs†  s™   € ð 	Œ×!Ò!Ð"?Ð"?Ð"?Ñ@Ô@Ð@ÝÔ" 4¤<Ñ0Ô0ˆÝ˜&¥/Ñ2Ô2Ð2Ð2Ð2Ø×Ò˜f¥oÑ6Ô6Ð6Ø×Ò˜˜FÔ.Ñ/Ô/Ð/Ø×Ò˜,˜¨Ô)@ÑAÔAÐAÐAÐAr"   c                ó  — | j                              g d¢¦  «         t          j        | j         ¦  «        }t	          |t
          ¦  «        sJ ‚|                      |t
          ¦  «         |                      t
          j        |j	        ¦  «         dS )zŸ
        L{_makeRunner} returns a L{TrialRunner} instance in C{DRY_RUN} mode
        when the C{--dry-run} option is passed, even if C{--jobs} is set.
        )r+  r  z	--dry-runN)
r
  r.   r   r2   r@  r   rö   rh   ÚDRY_RUNÚmoderc   s     r!   Útest_dryRunWithJobsz#MakeRunnerTests.test_dryRunWithJobs“  s€   € ð
 	Œ×!Ò!Ð">Ð">Ð">Ñ?Ô?Ð?ÝÔ" 4¤<Ñ0Ô0ˆÝ˜&¥+Ñ.Ô.Ð.Ð.Ð.Ø×Ò˜f¥kÑ2Ô2Ð2Ø×Ò�Ô,¨f¬kÑ:Ô:Ð:Ð:Ð:r"   c                ó"  ‡— t           j        j        Šdˆfd„}|                      t           j        d|¦  «         t          j        ¦   «         }|                     g d¢¦  «         |                      t           j        t           j        |¦  «         d S )	NÚfqnr   r   rí   c                ód   •— | dk    rt           j                             | ¦  «        ‚ ‰| ¦  «        S )NÚ	doNotFind)r   ÚreflectÚModuleNotFound)rI  ÚnamedAnys    €r!   ÚnamedAnyExceptdoNotFindzFMakeRunnerTests.test_DebuggerNotFound.<locals>.namedAnyExceptdoNotFind¡  s2   ø€ Ø�kÒ!Ð!Ý”m×2Ò2°3Ñ7Ô7Ð7Ø�8˜C‘=”=Ð r"   rN  )r,  z
--debuggerrK  )rI  r   r   rí   )	r   rL  rN  rX   r-   r.   rÆ   Ú_DebuggerNotFoundr2   )rC   rO  r
  rN  s      @r!   Útest_DebuggerNotFoundz%MakeRunnerTests.test_DebuggerNotFoundž  s�   ø€ Ý”=Ô)ˆð	!ð 	!ð 	!ð 	!ð 	!ð 	!ð
 	�
Š
•5”= *Ð.EÑFÔFÐFå”-‘/”/ˆØ×ÒÐCÐCÐCÑDÔDÐDà×Ò�%Ô1µ5Ô3DÀgÑNÔNÐNÐNÐNr"   c                óÐ   — | j                              dg¦  «         t          j        | j         ¦  «        }t	          |t
          ¦  «        sJ ‚|                      |j        ¦  «         dS )z‚
        Passing C{--exitfirst} wraps the reporter with a
        L{reporter._ExitWrapper} that stops on any non-success.
        z--exitfirstN)r
  r.   r   r2   r@  r   rß   Ú
_exitFirstrc   s     r!   Útest_exitfirstzMakeRunnerTests.test_exitfirst­  s_   € ð
 	Œ×!Ò! = /Ñ2Ô2Ð2ÝÔ" 4¤<Ñ0Ô0ˆÝ˜&¥+Ñ.Ô.Ð.Ð.Ð.Ø�Š˜Ô)Ñ*Ô*Ð*Ð*Ð*r"   Nrl   )	rO   rP   rQ   rR   r\   rC  rG  rQ  rT  r'   r"   r!   r;  r;  ~  sŠ   € € € € € ðð ð'ð 'ð 'ð 'ðBð Bð Bð Bð	;ð 	;ð 	;ð 	;ðOð Oð Oð Oð+ð +ð +ð +ð +ð +r"   r;  c                  ó"   — e Zd ZdZdd„Zdd„ZdS )ÚRunTestsz(
    Tests for the L{run} function.
    r   r#   c                óJ   — |                       t          j        dd„ ¦  «         d S )Nr.   c                ó   — d S r|   r'   r`   s    r!   ú<lambda>z RunTests.setUp.<locals>.<lambda>À  s   € ¸t€ r"   )rX   r   r-   r`   s    r!   r\   zRunTests.setUp½  s&   € ð 	�
Š
•5”= .Ð2CÐ2CÑDÔDÐDÐDÐDr"   c                ó  — dd„}|                       t          d|¦  «         	 t          j        ¦   «          |                      d¦  «         d
S # t          $ r.}|                      d	t          |¦  «        ¦  «         Y d
}~d
S d
}~ww xY w)zY
        When a debugger is not found, an error message is printed to the user.

        r(  rí   Úkwargsr   r#   c                 ó*   — t          j        d¦  «        ‚rÄ   )r   rP  )r(  r[  s     r!   r2   z3RunTests.test_debuggerNotFound.<locals>._makeRunnerÈ  s   € ÝÔ)¨%Ñ0Ô0Ð0r"   r2   z0Should have exited due to non-existent debugger!r¿   N)r(  rí   r[  rí   r   r#   )rX   r   r6   ÚfailÚ
SystemExitr&  r   )rC   r2   Úes      r!   Útest_debuggerNotFoundzRunTests.test_debuggerNotFoundÂ  s§   € ð	1ð 	1ð 	1ð 	1ð 	�
Š
•5˜-¨Ñ5Ô5Ð5ð	JÝŒI‰KŒKˆKð �IŠIÐHÑIÔIÐIÐIÐIøõ ð 	)ð 	)ð 	)Ø�MŠM˜%¥ Q¡¤Ñ(Ô(Ð(Ð(Ð(Ð(Ð(Ð(Ð(øøøøð	)øøøs   ¢A Á
BÁ#A?Á?BNrl   )rO   rP   rQ   rR   r\   r`  r'   r"   r!   rV  rV  ¸  sP   € € € € € ðð ðEð Eð Eð Eð
Jð Jð Jð Jð Jð Jr"   rV  c                  ó"   — e Zd ZdZdd„Zdd„ZdS )ÚTestArgumentOrderTestszQ
    Tests for the order-preserving behavior on provided command-line tests.
    r   r#   c                ó\   — t          j        ¦   «         | _        t          ¦   «         | _        d S r|   )r   r-   r/   r   ru   r`   s    r!   r\   zTestArgumentOrderTests.setUpÚ  s   € Ý”m‘o”oˆŒÝ ‘l”lˆŒˆˆr"   c                ó*  — g d¢}| j                              |¦  «         t          j        | j         ¦  «        }t	          |¦  «        }t          t          | j        j        |¦  «        ¦  «        }t	          |¦  «        }|  	                    ||¦  «         dS )zN
        Multiple tests passed on the command line are not reordered.
        )r´   z"twisted.trial.test.test_assertionsz twisted.trial.test.test_deferredN)
r/   r.   r   r–   r   r   r‡   ru   rˆ   rh   )rC   rŽ   r8   r„   ÚexpectedSuiteÚexpectedNamess         r!   Útest_preserveArgumentOrderz1TestArgumentOrderTests.test_preserveArgumentOrderÞ  sŽ   € ð
ð 
ð 
ˆð
 	Œ× Ò  Ñ'Ô'Ð'å” ¤Ñ,Ô,ˆÝ˜%Ñ Ô ˆå!¥# d¤kÔ&<¸eÑ"DÔ"DÑEÔEˆÝ! -Ñ0Ô0ˆà×Ò˜ Ñ.Ô.Ð.Ð.Ð.r"   Nrl   )rO   rP   rQ   rR   r\   rg  r'   r"   r!   rb  rb  Õ  sF   € € € € € ðð ð#ð #ð #ð #ð/ð /ð /ð /ð /ð /r"   rb  c                  óZ   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd„Zdd	„Z	dd
„Z
dd„Zdd„ZdS )Ú
OrderTestsz'
    Tests for the --order option.
    r   r#   c                ó6   — t          j        ¦   «         | _        d S r|   rp   r`   s    r!   r\   zOrderTests.setUp÷  r}   r"   c                óú   — | j                              g d¢¦  «         t          j        | j         ¦  «        }|                     | j         d         ¦  «        }|                      t          |¦  «        g d¢¦  «         dS )zn
        --order=alphabetical causes trial to run tests alphabetically within
        each test case.
        )r6  r7  ú%twisted.trial.test.ordertests.FooTestrŽ   )ú0twisted.trial.test.ordertests.FooTest.test_firstú1twisted.trial.test.ordertests.FooTest.test_fourthú1twisted.trial.test.ordertests.FooTest.test_secondú0twisted.trial.test.ordertests.FooTest.test_thirdN©r/   r.   r   rr   ÚloadByNamesrh   r   ©rC   ru   r8   s      r!   Útest_alphabeticalzOrderTests.test_alphabeticalú  s‘   € ð
 	Œ× Ò ØPÐPÐPñ	
ô 	
ð 	
õ Ô! $¤+Ñ.Ô.ˆØ×"Ò" 4¤;¨wÔ#7Ñ8Ô8ˆà×ÒÝ�eÑÔðð ð ñ	
ô 	
ð 	
ð 	
ð 	
r"   c                óú   — | j                              g d¢¦  «         t          j        | j         ¦  «        }|                     | j         d         ¦  «        }|                      t          |¦  «        g d¢¦  «         dS )zu
        --order=alphabetical causes trial to run test classes within a given
        module alphabetically.
        )r6  r7  útwisted.trial.test.ordertestsrŽ   )ú.twisted.trial.test.ordertests.BarTest.test_barú.twisted.trial.test.ordertests.BazTest.test_bazrm  rn  ro  rp  Nrq  rs  s      r!   Útest_alphabeticalModulez"OrderTests.test_alphabeticalModule  s‘   € ð
 	Œ× Ò ØHÐHÐHñ	
ô 	
ð 	
õ Ô! $¤+Ñ.Ô.ˆØ×"Ò" 4¤;¨wÔ#7Ñ8Ô8ˆà×ÒÝ�eÑÔðð ð ñ
	
ô 
	
ð 
	
ð 
	
ð 
	
r"   c                óB  — | j                              g d¢¦  «         t          j        | j         ¦  «        }|                     | j         d         ¦  «        }t          |¦  «        }|                      |d¬¦  «         |                      |t          |¦  «        ¦  «         dS )z¢
        --order=alphabetical causes trial to run test modules within a given
        package alphabetically, with tests within each module alphabetized.
        )r6  r7  útwisted.trial.testrŽ   zFailed to load any tests!©ÚmsgN)	r/   r.   r   rr   rr  r   rß   rh   Úsorted©rC   ru   r8   r„   s       r!   Útest_alphabeticalPackagez#OrderTests.test_alphabeticalPackage'  s“   € ð
 	Œ× Ò Ð!RÐ!RÐ!RÑSÔSÐSÝÔ! $¤+Ñ.Ô.ˆØ×"Ò" 4¤;¨wÔ#7Ñ8Ô8ˆå˜%Ñ Ô ˆØ�Š˜Ð#>ˆÑ?Ô?Ð?Ø×Ò˜¥ u¡¤Ñ.Ô.Ð.Ð.Ð.r"   c                óú   — | j                              g d¢¦  «         t          j        | j         ¦  «        }|                     | j         d         ¦  «        }|                      t          |¦  «        g d¢¦  «         dS )z°
        --order=toptobottom causes trial to run test methods within a given
        test case from top to bottom as they are defined in the body of the
        class.
        )r6  Útoptobottomrl  rŽ   )rm  ro  rp  rn  Nrq  rs  s      r!   Útest_toptobottomzOrderTests.test_toptobottom4  s‘   € ð 	Œ× Ò ØOÐOÐOñ	
ô 	
ð 	
õ Ô! $¤+Ñ.Ô.ˆØ×"Ò" 4¤;¨wÔ#7Ñ8Ô8ˆà×ÒÝ�eÑÔðð ð ñ	
ô 	
ð 	
ð 	
ð 	
r"   c                óú   — | j                              g d¢¦  «         t          j        | j         ¦  «        }|                     | j         d         ¦  «        }|                      t          |¦  «        g d¢¦  «         dS )z£
        --order=toptobottom causes trial to run test classes within a given
        module from top to bottom as they are defined in the module's source.
        ©r6  r‚  rv  rŽ   )rm  ro  rp  rn  rx  rw  Nrq  rs  s      r!   Útest_toptobottomModulez!OrderTests.test_toptobottomModuleK  s‘   € ð
 	Œ× Ò ØGÐGÐGñ	
ô 	
ð 	
õ Ô! $¤+Ñ.Ô.ˆØ×"Ò" 4¤;¨wÔ#7Ñ8Ô8ˆà×ÒÝ�eÑÔðð ð ñ
	
ô 
	
ð 
	
ð 
	
ð 
	
r"   c                ó  — | j                              g d¢¦  «         t          j        | j         ¦  «        }|                     | j         d         ¦  «        }t          |¦  «        }|                      |t          |d„ ¬¦  «        ¦  «         dS )z®
        --order=toptobottom causes trial to run test modules within a given
        package alphabetically, with tests within each module run top to
        bottom.
        )r6  r‚  r{  rŽ   c                ó<   — |                       d¦  «        d d…         S )NrK   r?  )Úsplit)Únames    r!   rY  z4OrderTests.test_toptobottomPackage.<locals>.<lambda>q  s   € ¨4¯:ª:°c©?¬?¸2¸A¸2Ô+>€ r"   )ÚkeyN)r/   r.   r   rr   rr  r   rh   r~  r  s       r!   Útest_toptobottomPackagez"OrderTests.test_toptobottomPackageb  s•   € ð 	Œ× Ò Ð!QÐ!QÐ!QÑRÔRÐRÝÔ! $¤+Ñ.Ô.ˆØ×"Ò" 4¤;¨wÔ#7Ñ8Ô8ˆå˜%Ñ Ô ˆð 	×ÒØÝ�5Ð>Ð>Ð?Ñ?Ô?ñ	
ô 	
ð 	
ð 	
ð 	
r"   c                ó  — |                       ¦   «         }t          |¦  «                             d¦  «        }|                     ¦   «          |                     d¦  «                             d¦  «         |                     d¦  «                             t          j        d¦  «                             d¦  «        ¦  «         |                     ¦   «         j	        }t          j	                             d|¦  «         |                      t          j	        j        |¦  «         ddlm} |                      t          j        j        d¦  «         |                      t          j        j        |j        ¦  «         |                     d¦  «                             ¦   «          | j                             g d	¢¦  «         t+          j        | j        ¦  «        }|                     |¦  «        }|                      t3          |¦  «        g d
¢¦  «         dS )z{
        --order=toptobottom detects the source line of methods from modules
        whose source file is missing.
        Útwisted_toptobottom_tempz__init__.pyr"   ztest_missing.pya   
        from twisted.trial.unittest import TestCase
        class TestMissing(TestCase):
            def test_second(self) -> None: pass
            def test_third(self) -> None: pass
            def test_fourth(self) -> None: pass
            def test_first(self) -> None: pass
        Úutf8r   )Útest_missingr…  )z=twisted_toptobottom_temp.test_missing.TestMissing.test_secondz<twisted_toptobottom_temp.test_missing.TestMissing.test_thirdz=twisted_toptobottom_temp.test_missing.TestMissing.test_fourthz<twisted_toptobottom_temp.test_missing.TestMissing.test_firstN)r  r   r  ÚmakedirsÚ
setContentÚtextwrapÚdedentÚencodeÚparentrL   r¦   Úinsertr  r'  rŽ  r�  r×   rë   rO   r/   r.   r   rr   Ú
loadModulerh   r   )rC   ÚtempdirÚpackageÚ	pathEntryr�  ru   r8   s          r!   Útest_toptobottomMissingSourcez(OrderTests.test_toptobottomMissingSourcet  sà  € ð
 —+’+‘-”-ˆÝ˜7Ñ#Ô#×)Ò)Ð*DÑEÔEˆØ×ÒÑÔÐØ�Š�mÑ$Ô$×/Ò/°Ñ4Ô4Ð4Ø�ŠÐ'Ñ(Ô(×3Ò3ÝŒOðñ	ô 	÷ Šf�V‰nŒnñ	
ô 	
ð 	
ð —N’NÑ$Ô$Ô)ˆ	ÝŒ�Š˜˜9Ñ%Ô%Ð%Ø�Š�œœ¨Ñ3Ô3Ð3ð	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	�Š�œœÐ)CÑDÔDÐDØ�Š�œœ¨Ô)>Ñ?Ô?Ð?Ø�ŠÐ'Ñ(Ô(×/Ò/Ñ1Ô1Ð1àŒ× Ò ØGÐGÐGñ	
ô 	
ð 	
õ Ô! $¤+Ñ.Ô.ˆØ×!Ò! ,Ñ/Ô/ˆà×ÒÝ�eÑÔðð ð ñ	
ô 	
ð 	
ð 	
ð 	
r"   c                óV   — |                       t          | j        j        ddg¦  «         dS )zL
        An unknown order passed to --order raises a L{UsageError}.
        r6  zI don't existN)rÆ   r   r/   r.   r`   s    r!   Útest_unknownOrderzOrderTests.test_unknownOrder¤  s7   € ð
 	×ÒÝ˜œÔ0°9¸oÐ2Nñ	
ô 	
ð 	
ð 	
ð 	
r"   Nrl   )rO   rP   rQ   rR   r\   rt  ry  r€  rƒ  r†  rŒ  rœ  rž  r'   r"   r!   ri  ri  ò  sÓ   € € € € € ðð ð&ð &ð &ð &ð
ð 
ð 
ð 
ð,
ð 
ð 
ð 
ð./ð /ð /ð /ð
ð 
ð 
ð 
ð.
ð 
ð 
ð 
ð.
ð 
ð 
ð 
ð$.
ð .
ð .
ð .
ð`
ð 
ð 
ð 
ð 
ð 
r"   ri  c                  ó   — e Zd ZdZdd„ZdS )ÚHelpOrderTestsz+
    Tests for the --help-orders flag.
    r   r#   c                ó$  — |                       t          dt          ¦   «         x}¦  «         |                      t          t          j        ¦   «         j        dg¦  «        }|                      |j	        d¦  «         | 
                    ¦   «         }d}t
          j                             ¦   «         D ]b\  }\  }}t          j        t          j        |¦  «        › dt          j        |¦  «        › �|¦  «        }|                      ||||fz  ¬¦  «         ŒcdS )zS
        --help-orders prints each of the available orders and then exits.
        Ústdoutz--help-ordersr   z4%r with its description not properly described in %rz.*r|  N)rX   r¦   r   rÆ   r^  r   r-   r.   rh   Úcoder¨   Ú
_runOrdersÚitemsÚreÚsearchÚescaperß   )	rC   r¢  ÚexcÚoutputr}  Ú	orderNameÚ	orderDescÚ_Úmatchs	            r!   Ú&test_help_ordersPrintsSynopsisAndQuitsz5HelpOrderTests.test_help_ordersPrintsSynopsisAndQuits³  s  € ð 	�
Š
•3˜­H©J¬JÐ"6 &Ñ7Ô7Ð7à×ÒÝ�œ™œÔ4°Ð6Gñ
ô 
ˆð 	×Ò˜œ 1Ñ%Ô%Ð%à—’Ñ"Ô"ˆàDˆÝ).Ô)9×)?Ò)?Ñ)AÔ)Að 	Bð 	BÑ%ˆI‘~˜	 1Ý”IÝ”9˜YÑ'Ô'ÐAÐA­2¬9°YÑ+?Ô+?ÐAÐAØñô ˆEð
 �OŠO˜E s¨i¸Ð-@Ñ'@ˆOÑAÔAÐAÐAð	Bð 	Br"   Nrl   )rO   rP   rQ   rR   r¯  r'   r"   r!   r   r   ®  s8   € € € € € ðð ðBð Bð Bð Bð Bð Br"   r   )r   r   r   r   rl   )r)   r*   r   r+   )r/   r+   r   r+   )BÚ
__future__r   rY   r¦  r¦   r“  r÷   Úior   Útypingr   Úhamcrestr   r   Ú
hypothesisr   Úhypothesis.strategiesr	   Útwisted.loggerr
   Útwisted.pythonr   Útwisted.python.filepathr   r   Útwisted.python.usager   Útwisted.scriptsr   Útwisted.trialr   Útwisted.trial._dist.disttrialr   Útwisted.trial._dist.functionalr   Útwisted.trial.runnerr   r   r   r   r   Útwisted.trial.test.test_loaderr   Úmatchersr   Ú
__import__r4   r   r(   r0   r9   rA   ÚSynchronousTestCaser;   rT   rn   rz   rä   r  ÚTestCaser  r;  rV  rb  ri  r   r'   r"   r!   ú<module>rÄ     s“  ðð #Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø 	€	€	€	Ø 
€
€
€
Ø €€€Ø €€€Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø Ð Ð Ð Ð Ð Ø .Ð .Ð .Ð .Ð .Ð .à !Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð Ø 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ø +Ð +Ð +Ð +Ð +Ð +Ø !Ð !Ð !Ð !Ð !Ð !Ø "Ð "Ð "Ð "Ð "Ð "Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2ðð ð ð ð ð ð ð ð ð ð ð ð ð ð 5Ð 4Ð 4Ð 4Ð 4Ð 4Ø "Ð "Ð "Ð "Ð "Ð "à	ˆ�JÑ	Ô	€ð,ð ,ð ,ð ,ðð ð ð ðð ð ð ðð ð ð ð �7˜=¨.Ñ9Ô9Ð ð=Gð =Gð =Gð =Gð =G�8Ô/ñ =Gô =Gð =Gð@45ð 45ð 45ð 45ð 45 (Ô">ñ 45ô 45ð 45ðn9ð 9ð 9ð 9ð 9�XÔ1ñ 9ô 9ð 9ð8Ið Ið Ið Ið I�hÔ2ñ Iô Ið IðXL8ð L8ð L8ð L8ð L8˜Ô5ñ L8ô L8ð L8ð^0Oð 0Oð 0Oð 0Oð 0O�HÔ0ñ 0Oô 0Oð 0OðfOVð OVð OVð OVð OV�8Ô$ñ OVô OVð OVðd7+ð 7+ð 7+ð 7+ð 7+�hÔ'ñ 7+ô 7+ð 7+ðtJð Jð Jð Jð JˆxÔ ñ Jô Jð Jð:/ð /ð /ð /ð /˜XÔ.ñ /ô /ð /ð:y
ð y
ð y
ð y
ð y
�Ô"ñ y
ô y
ð y
ðxBð Bð Bð Bð B�XÔ&ñ Bô Bð Bð Bð Br"   