
[XMc           @   s|  d  Z  d d l Z d d l Z d d l Z d d l Z d d l m Z m Z d d l m	 Z	 m
 Z
 m Z m Z d d l m Z m Z d d l m Z d d- d     YZ d	 e	 j f d
     YZ d e	 j e f d     YZ d e	 j e f d     YZ d e	 j e f d     YZ d e	 j e f d     YZ d e	 j e f d     YZ d e	 j f d     YZ d e	 j f d     YZ d e	 j f d     YZ d d. d     YZ d e e	 j f d     YZ d e e	 j f d      YZ d! e	 j f d"     YZ  d# e	 j f d$     YZ! d% e	 j f d&     YZ" d' e	 j f d(     YZ# d) e	 j f d*     YZ$ d+ e	 j f d,     YZ% d S(/   s(   
Tests for the behaviour of unit tests.
iN(   t   defert   reactor(   t   unittestt   runnert   reportert   util(   t	   erroneoust   suppression(   t   LoggingReportert   ResultsTestMixinc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s7   t  j   |  _ |  j j |  |  _ t j   |  _ d  S(   N(   R   t
   TestLoadert   loadert	   loadClasst   suiteR   t
   TestResult(   t   selfR   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt	   loadSuite   s    c         C   s\   |  j  |  j j    |  j |  j j g   |  j |  j j g   |  j |  j j g   d  S(   N(   t
   failUnlessR   t   wasSuccessfult   failUnlessEqualt   errorst   failurest   skips(   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_setUp   s    c         C   sC   |  j  |  j j   |  |  j |  j  |  j  |  j j |  d  S(   N(   R   R   t   countTestCasesR   t   testsRun(   R   t   numTests(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   assertCount   s    (   t   __name__t
   __module__R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR	      s   		t   TestSuccessc           B   sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s:   
    Test that successful tests are reported as such.
    c         C   s   t  j   |  _ d  S(   N(   R   R   t   result(   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   setUp(   s    c         C   s   d S(   s9   
        A successful test, used by other tests.
        N(    (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_successful,   s    c         C   sv   |  j  | j d  |  j  | j g   |  j  | j g   |  j  | j g   |  j  | j g   |  j  | j g   d  S(   Ni   (   t   assertEqualt	   successesR   R   t   expectedFailurest   unexpectedSuccessesR   (   R   t   testR   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   assertSuccessful2   s    c         C   s3   t  d  } | j |  j  |  j | |  j  d S(   s   
        Test that when a successful test is run, it is reported as a success,
        and not as any other kind of result.
        R!   N(   R   t   runR   R'   (   R   R&   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_successfulIsReported;   s    c         C   s3   t  j   } | j |  j  |  j | |  j  d S(   s{   
        Test that L{unittest.TestCase} itself can be instantiated, run, and
        reported as being successful.
        N(   R   t   TestCaseR(   R   R'   (   R   R&   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_defaultIsSuccessfulE   s    c         C   sb   t  d  } t j |  } | j |  j  |  j | |  j  ~ t j   |  j |   d  d S(   sF   
        Test that no reference is kept on a successful test.
        R!   N(
   R   t   weakreft   refR(   R   R'   t   gct   collectt   assertIdenticalt   None(   R   R&   R-   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_noReferenceO   s    
(	   R   R   t   __doc__R    R!   R'   R)   R+   R2   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   #   s   					
	
t   TestSkipMethodsc           B   sg   e  Z d  e j f d     YZ d e j f d     YZ d   Z d   Z d   Z d   Z	 d   Z
 RS(	   t   SkippingTestsc           B   s5   e  Z d    Z d   Z d e _ d   Z d e _ RS(   c         C   s   t  j d   d  S(   Nt   skip1(   R   t   SkipTest(   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_skip1_   s    c         C   s   t  d   d  S(   Ns   I should not get raised(   t   RuntimeError(   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_skip2b   s    t   skip2c         C   s   |  j  d  d  S(   Ns   I should not fail(   t   fail(   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_skip3f   s    t   skip3(   R   R   R8   R:   t   skipR=   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR5   ^   s
   				t   SkippingSetUpc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   t  j d   d  S(   Nt	   skipSetUp(   R   R7   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR    k   s    c         C   s   d  S(   N(    (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_1n   s    c         C   s   d  S(   N(    (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_2q   s    (   R   R   R    RB   RC   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR@   j   s   		c         C   s   |  j  t j  d  S(   N(   R   R4   R5   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR    t   s    c         C   s   |  j  d  d  S(   Ni   (   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_countingw   s    c         C   sr   |  j  |  j  |  j |  j j    |  j |  j j g   |  j |  j j g   |  j t |  j j  d  d  S(   Ni   (	   R   R   R   R   R   R   R   t   lenR   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_resultsz   s
    c         C   s   |  j  t j  |  j |  j  |  j |  j j    |  j |  j j g   |  j |  j j	 g   |  j t
 |  j j  d  d  S(   Ni   (   R   R4   R@   R   R   R   R   R   R   R   RE   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR      s    c         C   s]   |  j  |  j  d } x@ |  j j D]2 \ } } |  j | j   t |  t |   q# Wd  S(   Nt   test_(   R   R   R   R   t   shortDescriptionRE   t   str(   R   t   prefixR&   t   reason(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_reasons   s
    (   R   R   R   R*   R5   R@   R    RD   RF   R   RL   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR4   ]   s   
				t   TestSkipClassesc           B   sN   e  Z d  e j f d     YZ d   Z d   Z d   Z d   Z d   Z	 RS(   t   SkippedClassc           B   sD   e  Z d  Z d   Z d   Z d   Z d e _ d   Z d   Z RS(   t   classc         C   s   t  |  j _ d  S(   N(   t   Truet	   __class__t	   _setUpRan(   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR       s    c         C   s   t  j d   d  S(   NR6   (   R   R7   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR8      s    c         C   s   t  d   d  S(   Ns   Ought to skip me(   R9   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR:      s    R;   c         C   s   d  S(   N(    (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR=      s    c         C   s   t  d   d  S(   Ns   Skip me too(   R9   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_skip4   s    (   R   R   R?   R    R8   R:   R=   RS   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRN      s   					c         C   s    |  j  t j  t t j _ d  S(   N(   R   RM   RN   t   FalseRR   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR       s    c         C   s   |  j  d  d S(   sP   
        Skipped test methods still contribute to the total test count.
        i   N(   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRD      s    c         C   s'   |  j  |  j  |  j t j j  d S(   sP   
        The C{setUp} method is not called if the class is set to skip.
        N(   R   R   t   assertFalseRM   RN   RR   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_setUpRan   s    c         C   sr   |  j  |  j  |  j |  j j    |  j |  j j g   |  j |  j j g   |  j t |  j j  d  d S(   s   
        Skipped test methods don't cause C{wasSuccessful} to return C{False},
        nor do they contribute to the C{errors} or C{failures} of the reporter.
        They do, however, add elements to the reporter's C{skips} list.
        i   N(	   R   R   R   R   R   R   R   RE   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRF      s
    c         C   s[   |  j  |  j  d d d d g } g  |  j j D] \ } } | ^ q/ } |  j | |  d S(   s   
        Test methods which raise L{unittest.SkipTest} or have their C{skip}
        attribute set to something are skipped.
        RO   R;   N(   R   R   R   t   assertEquals(   R   t   expectedReasonsR&   RK   t   reasonsGiven(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRL      s    %(
   R   R   R   R*   RN   R    RD   RV   RF   RL   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRM      s   				t   TestTodoc           B   sN   e  Z d  e j f d     YZ d   Z d   Z d   Z d   Z d   Z	 RS(   t	   TodoTestsc           B   s>   e  Z d    Z d e _ d   Z d e _ d   Z d e _ RS(   c         C   s   |  j  d  d  S(   Ns   deliberate failure(   R<   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_todo1   s    t   todo1c         C   s   t  d   d  S(   Ns   deliberate error(   R9   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_todo2   s    t   todo2c         C   s   d S(   s   unexpected successN(    (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_todo3   s    t   todo3(   R   R   R\   t   todoR^   R`   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR[      s   					c         C   s   |  j  t j  d  S(   N(   R   RZ   R[   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR       s    c         C   s   |  j  d  d  S(   Ni   (   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRD      s    c         C   s   |  j  |  j  |  j |  j j    |  j |  j j g   |  j |  j j g   |  j |  j j g   |  j t |  j j	  d  |  j t |  j j
  d  d  S(   Ni   i   (   R   R   R   R   R   R   R   R   RE   R$   R%   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRF      s    c         C   s[   |  j  |  j  d d g } g  |  j j D] \ } } } | j ^ q) } |  j | |  d  S(   NR]   R_   (   R   R   R$   RK   R   (   R   RX   t   tt   et   rRY   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_expectedFailures   s
    (c         C   sU   |  j  |  j  d g } g  |  j j D] \ } } | j ^ q& } |  j | |  d  S(   NRa   (   R   R   R%   RK   R   (   R   RX   Rc   Re   RY   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_unexpectedSuccesses   s
    	%(
   R   R   R   R*   R[   R    RD   RF   Rf   Rg   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRZ      s   					t   TestTodoClassc           B   sW   e  Z d  e j f d     YZ d e _ d   Z d   Z d   Z d   Z	 d   Z
 RS(   t	   TodoClassc           B   s>   e  Z d    Z d e _ d   Z d   Z d e _ d   Z RS(   c         C   s   d  S(   N(    (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR\      s    t   methodc         C   s   d  S(   N(    (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR^     s    c         C   s   |  j  d  d  S(   Ns   Deliberate Failure(   R<   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR`     s    c         C   s   |  j  d  d  S(   Ns   Deliberate Failure(   R<   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_todo4  s    (   R   R   R\   Rb   R^   R`   Rk   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRi      s   					RO   c         C   s   |  j  t j  d  S(   N(   R   Rh   Ri   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR    
  s    c         C   s   |  j  d  d  S(   Ni   (   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRD     s    c         C   s   |  j  |  j  |  j |  j j    |  j |  j j g   |  j |  j j g   |  j |  j j g   |  j t |  j j	  d  |  j t |  j j
  d  d  S(   Ni   (   R   R   R   R   R   R   R   R   RE   R$   R%   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRF     s    c         C   s[   |  j  |  j  d d g } g  |  j j D] \ } } } | j ^ q) } |  j | |  d  S(   NRj   RO   (   R   R   R$   RK   R   (   R   RX   Rc   Rd   Re   RY   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRf     s
    (c         C   sX   |  j  |  j  d d g } g  |  j j D] \ } } | j ^ q) } |  j | |  d  S(   NRj   RO   (   R   R   R%   RK   R   (   R   RX   Rc   Re   RY   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRg      s
    %(   R   R   R   R*   Ri   Rb   R    RD   RF   Rf   Rg   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRh      s   						t   TestStrictTodoc           B   sN   e  Z d  e j f d     YZ d   Z d   Z d   Z d   Z d   Z	 RS(   t   Todosc           B   s   e  Z d    Z e d f e _ d   Z e e f d f e _ d   Z e d f e _ d   Z e e	 f d f e _ d   Z
 e j d	 f e
 _ d
   Z e d f e _ d   Z e d f e _ RS(   c         C   s   t  d  d  S(   Ns   expected failure(   R9   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR\   *  s    R]   c         C   s   t  d  d  S(   Ns   expected failure(   R9   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR^   .  s    R_   c         C   s   t  d  d  S(   Ns   we had no idea!(   R9   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR`   2  s    Ra   c         C   s   t  d  d  S(   Ns   we had no idea!(   R9   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRk   6  s    t   todo4c         C   s   |  j  d  d  S(   Ns   deliberate failure(   R<   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_todo5:  s    t   todo5c         C   s   |  j  d  d  S(   Ns   deliberate failure(   R<   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_todo6>  s    t   todo6c         C   s   d  S(   N(    (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_todo7B  s    t   todo7(   R   R   R\   R9   Rb   R^   t   OSErrorR`   Rk   t   SyntaxErrorRo   R   t   FailTestRq   Rs   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRm   )  s   							c         C   s   |  j  t j  d  S(   N(   R   Rl   Rm   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR    F  s    c         C   s   |  j  d  d  S(   Ni   (   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRD   I  s    c         C   s   |  j  |  j  |  j |  j j    |  j t |  j j  d  |  j t |  j j  d  |  j t |  j j  d  |  j t |  j j	  d  |  j |  j j
 g   d  S(   Ni   i   i   (   R   R   t   failIfR   R   RE   R   R   R$   R%   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRF   L  s    c         C   s^   |  j  |  j  d d d g } g  |  j j D] \ } } } | j ^ q, } |  j | |  d  S(   NR]   R_   Rp   (   R   R   R$   RK   R   (   R   RX   Rc   Rd   Re   t   reasonsGotten(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRf   U  s
    (c         C   sg   |  j  |  j  t g d f g } g  |  j j D] \ } } | j | j f ^ q/ } |  j | |  d  S(   NRt   (   R   R   R9   R%   R   RK   R   (   R   RX   Rc   Re   Ry   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRg   \  s
    .(
   R   R   R   R*   Rm   R    RD   RF   Rf   Rg   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRl   (  s   					t   TestCleanupc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s+   t  j t j    |  _ t j   |  _ d  S(   N(   R   t   Reportert   StringIOR   R   R
   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR    g  s    c         C   s   |  j  j t j j  } | j |  j  |  j |  j j    |  j	 |  j j
 d  |  j j d d } |  j | j t j   d S(   sm   
        Trial reports a L{util.DirtyReactorAggregateError} if a test leaves
        sockets behind.
        i   i    N(   R   t
   loadMethodR   t   SocketOpenTestt   test_socketsLeftOpenR(   R   Rx   R   R"   R#   R   R   t   checkR   t   DirtyReactorAggregateError(   R   R   t   failure(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   testLeftoverSocketsl  s    	c         C   s|   t  j d  } | j |  j  |  j |  j j    |  j j d d } |  j |  j j d  |  j	 | j
 t j   d S(   s   
        Trial reports a L{util.DirtyReactorAggregateError} and fails the test
        if a test leaves a L{DelayedCall} hanging.
        t   test_leftoverPendingCallsi    i   N(   R   t   ReactorCleanupTestsR(   R   Rx   R   R   R"   R#   R   R   R   R   (   R   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   testLeftoverPendingCalls}  s    (   R   R   R    R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRz   e  s   		t   FixtureTestc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   sI   
    Tests for broken fixture helper methods (e.g. setUp, tearDown).
    c         C   s"   t  j   |  _  t j   |  _ d  S(   N(   R   R{   R   R
   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR      s    c         C   sl   |  j  j t j  j |  j  |  j t |  j j  d k  |  j t	 |  j j d d j
 t j   d S(   sO   
        When setUp fails, the error is recorded in the result object.
        i    i   N(   R   R   R   t   TestFailureInSetUpR(   R   t   assert_RE   R   t
   isinstancet   valuet   FoolishError(   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   testBrokenSetUp  s    c         C   sr   |  j  j t j  } | j |  j  |  j j } |  j t |  d k  |  j t	 | d d j
 t j   d S(   sR   
        When tearDown fails, the error is recorded in the result object.
        i    i   N(   R   R   R   t   TestFailureInTearDownR(   R   R   R   RE   R   R   R   (   R   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   testBrokenTearDown  s
    (   R   R   R3   R    R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR     s   		
t   SuppressionTestc           B   s>   e  Z d    Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   s   | j  t j    d  S(   N(   R(   R   R   (   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   runTests  s    c         C   s   t  j   |  _ d  S(   N(   R   R
   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR      s    c         C   s   |  j  |  j j t j j   |  j t j j g  } |  j | d d t j	  |  j | d d t j
  |  j t |  d  d S(   s   
        A suppression set on a test method prevents warnings emitted by that
        test method which the suppression matches from being emitted.
        i    t   messagei   i   N(   R   R   R}   R   t   TestSuppressiont   testSuppressMethodt   flushWarningst   _emitR"   t   CLASS_WARNING_MSGt   MODULE_WARNING_MSGRE   (   R   t   warningsShown(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_suppressMethod  s    c         C   s   |  j  |  j j t j j   |  j t j j g  } |  j | d d t j	  |  j | d d t j
  |  j t |  d  d S(   s   
        A suppression set on a L{TestCase} subclass prevents warnings emitted
        by any test methods defined on that class which match the suppression
        from being emitted.
        i    R   i   i   N(   R   R   R}   R   R   t   testSuppressClassR   R   R"   t   METHOD_WARNING_MSGR   RE   (   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_suppressClass  s    c         C   s   |  j  |  j j t j j   |  j t j j g  } |  j	 | d d t j
  |  j	 | d d t j  |  j	 t |  d  d S(   s   
        A suppression set on a module prevents warnings emitted by any test
        mewthods defined in that module which match the suppression from being
        emitted.
        i    R   i   i   N(   R   R   R}   R   t   TestSuppression2t   testSuppressModuleR   R   R   R"   R   R   RE   (   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_suppressModule  s    c         C   s   |  j  j t j j  } |  j |  |  j t j j g  } |  j | d d t j	  |  j | d d t j
  |  j | d d t j  |  j t |  d  d S(   s   
        The suppression set on a test method completely overrides a suppression
        with wider scope; if it does not match a warning emitted by that test
        method, the warning is emitted, even if a wider suppression matches.
        i    R   i   i   i   N(   R   R}   R   R   t   testOverrideSuppressClassR   R   R   R"   R   R   R   RE   (   R   t   caseR   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_overrideSuppressClass  s    	(   R   R   R   R    R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR     s   					t   GCMixinc           B   sd   e  Z d  Z d e j f d     YZ d e j f d     YZ d   Z d   Z d   Z	 d   Z
 RS(	   s   
    I provide a few mock tests that log setUp, tearDown, test execution and
    garbage collection. I'm used to test whether gc.collect gets called.
    t	   BasicTestc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   |  j  d  d  S(   NR    (   t   _log(   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR      s    c         C   s   |  j  d  d  S(   NR&   (   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_foo  s    c         C   s   |  j  d  d  S(   Nt   tearDown(   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR     s    (   R   R   R    R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR     s   		t	   ClassTestc           B   s   e  Z d    Z d   Z RS(   c         C   s   |  j  d  d  S(   Nt   test1(   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRB     s    c         C   s   |  j  d  d  S(   Nt   test2(   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyRC     s    (   R   R   RB   RC   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   
  s   	c         C   s   |  j  j |  d  S(   N(   t   _collectCalledt   append(   R   t   msg(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR     s    c         C   s   |  j  d  d S(   s   Fake gc.collectR/   N(   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR/     s    c         C   s>   g  |  _  |  j |  j _ |  j _ t j |  _ |  j t _ d  S(   N(   R   R   R   R   R.   R/   t   _oldCollect(   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR      s    	c         C   s   |  j  t _ d  S(   N(   R   R.   R/   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR     s    (   R   R   R3   R   R*   R   R   R   R/   R    R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR     s   			t   TestGarbageCollectionDefaultc           B   s   e  Z d    Z RS(   c         C   sH   |  j  d  } t j   } | j |  |  j |  j d d d g  d S(   sH   
        By default, tests should not force garbage collection.
        R   R    R&   R   N(   R   R   R   R(   R   R   (   R   R&   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_collectNotDefault$  s    (   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   "  s   t   TestGarbageCollectionc           B   s   e  Z d    Z RS(   c         C   s]   t  j d  } t j |  } t j   } | j |  |  j |  j d d d d d g  d S(   sG   
        test gc.collect is called before and after each test.
        R   R/   R    R&   R   N(	   R   R   R   t    _ForceGarbageCollectionDecoratorR   R   R(   R   R   (   R   R&   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_collectCalled1  s    (   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   /  s   t   TestUnhandledDeferredc           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C   s9   d d l  m } t j   t j | j d   |  _ d  S(   Ni(   t   weirdt   test_unhandledDeferred(   t   twisted.trial.testR   R.   t   disableR   R   t   TestBleedingR   (   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR    A  s    
c         C   s9   t  j   } |  j |  |  j t | j  d d  d S(   so   
        Forcing garbage collection should cause unhandled Deferreds to be
        reported as errors.
        i   s(   Unhandled deferred passed without noticeN(   R   R   R   R"   RE   R   (   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_isReportedH  s    c         C   sk   t  j   } |  j |  |  j   t j   } |  j | d d  |  j   } |  j t |  d d  d S(   s   
        Forcing garbage collection in the test should mean that there are
        no unreachable cycles immediately after the test completes.
        i    s   unreachable cycle still existeds   Errors logged after gc.collectN(   R   R   R   t   flushLoggedErrorsR.   R/   R"   RE   (   R   R   t   nt   x(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_doesntBleedR  s    
c         C   s"   t  j   t  j   |  j   d  S(   N(   R.   R/   t   enableR   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   b  s    

(   R   R   R    R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   ?  s   		
	t   TestAddCleanupc           B   so   e  Z d  Z d e j f d     YZ d   Z d   Z d   Z d   Z	 d   Z
 d   Z d	   Z d
   Z RS(   s1   
    Test the addCleanup method of TestCase.
    t   MockTestc           B   s>   e  Z d    Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   s   d g |  _  d  S(   NR    (   t   log(   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR    p  s    c         C   s   d g |  _  t d   d  S(   NR    s   Deliberate failure(   R   R9   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   brokenSetUps  s    c         C   s   d g |  _  t j d   d  S(   NR    s   Don't do this(   R   R   R7   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   skippingSetUpw  s    c         C   s   |  j  j |  d  S(   N(   R   R   (   R   t   thing(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   {  s    c         C   s   |  j  j d  d  S(   NR   (   R   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   ~  s    c         C   s   |  j  j d  d  S(   Nt   runTest(   R   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR     s    (   R   R   R    R   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   n  s   					c         C   s2   t  j j |   t j   |  _ t j   |  _ d  S(   N(	   R   R*   R    R   R   R   R   R   R&   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR      s    c         C   s^   |  j  j |  j  _ |  j  j |  j  j d  |  j  j |  j  |  j d d g |  j  j  d S(   sQ   
        Callables added with C{addCleanup} are run even if setUp fails.
        t   fooR    N(	   R&   R   R    t
   addCleanupR   R(   R   R"   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt!   test_addCleanupCalledIfSetUpFails  s    c         C   s^   |  j  j |  j  _ |  j  j |  j  j d  |  j  j |  j  |  j d d g |  j  j  d S(   s   
        Callables added with C{addCleanup} are run even if setUp raises
        L{SkipTest}. This allows test authors to reliably provide clean up
        code using C{addCleanup}.
        R   R    N(	   R&   R   R    R   R   R(   R   R"   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt!   test_addCleanupCalledIfSetUpSkips  s    c         C   sn   |  j  j |  j  j d  |  j  j |  j  j d  |  j  j |  j  |  j d d d d d g |  j  j  d S(   s~   
        Callables added with C{addCleanup} should be called before C{tearDown}
        in reverse order of addition.
        R   t   barR    R   R   N(   R&   R   R   R(   R   R"   R   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt#   test_addCleanupCalledInReverseOrder  s
    c            sw     f d   }   j  j   j  j d    j  j | d    j  j   j    j d d d d d g   j  j  d S(   s   
        If an added callable returns a L{Deferred}, then the test should wait
        until that L{Deferred} has fired before running the next cleanup
        method.
        c            s5   t  j   } t j d | j |   | j   j j  S(   Ni    (   R    t   DeferredR   t	   callLatert   callbackt   addCallbackR&   R   (   R   t   d(   R   (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   cleanup  s    R   R   R    R   R   N(   R&   R   R   R(   R   R"   R   (   R   R   (    (   R   sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt    test_addCleanupWaitsForDeferreds  s    c         C   s   |  j  j |  j  j d  |  j  j |  j  |  j |  j j    |  j d t |  j j	   |  j j	 \ \ } } |  j | |  j   |  j | j
   d  d S(   s   
        Errors raised in cleanup functions should be treated like errors in
        C{tearDown}. They should be added as errors and fail the test. Skips,
        todos and failures are all treated as errors.
        R   i   N(   R&   R   R<   R(   R   Rx   R   R"   RE   R   t   getErrorMessage(   R   R&   t   error(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_errorInCleanupIsCaptured  s    c         C   s   |  j  j |  j  j d  |  j  j |  j  j d  |  j  j |  j  |  j d d d d g |  j  j  |  j d t |  j j	   |  j j	 \ \ } } |  j | |  j   |  j | j
   d  d S(   sq   
        If a cleanup raises an error then that does not stop the other
        cleanups from being run.
        R   R   R    R   R   i   N(   R&   R   R   R<   R(   R   R"   R   RE   R   R   (   R   R&   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt&   test_cleanupsContinueRunningAfterError  s    c         C   s   |  j  j |  j  j d  |  j  j |  j  j d  |  j  j |  j  |  j d d d g |  j  j  |  j d t |  j j   |  j j \ \ } } \ } } |  j | |  j   |  j | |  j   |  j | j	   d  |  j | j	   d  d S(   sm   
        If more than one cleanup fails, then the test should fail with more
        than one error.
        R   R   R    R   R   i   N(
   R&   R   R<   R(   R   R"   R   RE   R   R   (   R   R   t   error1R   t   error2(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_multipleErrorsReported  s    (   R   R   R3   R   R*   R   R    R   R   R   R   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   i  s   		
					t   TestSuiteClearingc           B   s    e  Z d  Z d   Z d   Z RS(   sM   
    Tests for our extension that allows us to clear out a L{TestSuite}.
    c         C   s\   t  j   } | j t  j    |  j d | j    t  j |  |  j d | j    d S(   sh   
        Calling L{unittest._clearSuite} on a populated L{TestSuite} removes
        all tests.
        i   i    N(   R   t	   TestSuitet   addTestR*   R"   R   t   _clearSuite(   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_clearSuite  s
    c         C   sh   t  d  } | j   } | j t j    |  j d | j    t j |  |  j d | j    d S(   s   
        Calling L{unittest._clearSuite} on a populated standard library
        L{TestSuite} removes all tests.

        This test is important since C{_clearSuite} operates by mutating
        internal variables.
        R   i   i    N(   t
   __import__R   R   R   R*   R"   R   R   (   R   t   pyunitR   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_clearPyunitSuite  s    (   R   R   R3   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR     s   	t   TestTestDecoratorc           B   sq   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z RS(   s1   
    Tests for our test decoration features.
    c         C   s   |  j  | j | j d  t | d d  } t | d d  } |  j | |  | | k od d k n r| |  j | |  n  d S(   sB   
        Assert that the given decorated tests are equal.
        s   Different classt   _originalTestN(   R"   RQ   t   getattrR1   R0   (   R   t   observedt   expectedt   observedOriginalt   expectedOriginal(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   assertTestsEqual  s    c         C   s   |  j  | j | j d  |  j  t | j  t | j  d  x^ t | j | j  D]G \ } } t | d d  d k	 r |  j | |  qT |  j | |  qT Wd S(   sS   
        Assert that the given test suites with decorated tests are equal.
        s   Different classs   Different number of tests.t   _testsN(	   R"   RQ   RE   R   t   zipR   R1   t   assertSuitesEqualR   (   R   R   R   t   observedTestt   expectedTest(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR   (  s    c         C   sH   t  j   } t  j |  } t   } | j |  |  j | j |  d S(   s   
        For decorated tests, C{run} uses a result adapter that preserves the
        test decoration for calls to C{addError}, C{startTest} and the like.

        See L{reporter._AdaptedReporter}.
        N(   R   R*   t   TestDecoratorR   R(   R   R&   (   R   R&   t   decoratedTestR   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_usesAdaptedReporterWithRun8  s
    	c         C   sE   t  j   } t  j |  } t   } | |  |  j | j |  d S(   s   
        For decorated tests, C{__call__} uses a result adapter that preserves
        the test decoration for calls to C{addError}, C{startTest} and the
        like.

        See L{reporter._AdaptedReporter}.
        N(   R   R*   R   R   R   R&   (   R   R&   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt    test_usesAdaptedReporterWithCallF  s
    	
c         C   s>   t  j   } t  j | t  j  } |  j t  j |  |  d S(   s   
        Calling L{decorate} on a single test case returns the test case
        decorated with the provided decorator.
        N(   R   R*   t   decorateR   R   (   R   R&   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_decorateSingleTestU  s    c         C   s\   t  j   } t  j | g  } t  j | t  j  } |  j | t  j t  j |  g   d S(   s   
        Calling L{decorate} on a test suite will return a test suite with
        each test decorated with the provided decorator.
        N(   R   R*   R   R   R   R   (   R   R&   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_decorateTestSuite_  s
    c         C   s   t  j   } t  j | g  } t  j | t  j  } |  j | t  j t  j |  g   |  j | t  j t  j |  g   d S(   sU   
        Calling L{decorate} on a test suite will mutate the original suite.
        N(   R   R*   R   R   R   R   (   R   R&   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt#   test_decorateInPlaceMutatesOriginalk  s    c         C   s   t  t d d  } | d k r0 t j d   n  t j   } t j | g  } | |  } t j | t j  } | |  } |  j	 | |  d S(   sc  
        When decorating a test suite in-place, the number of references to the
        test objects in that test suite should stay the same.

        Previously, L{unittest.decorate} recreated a test suite, so the
        original suite kept references to the test objects. This test is here
        to ensure the problem doesn't reappear again.
        t   getrefcounts*   getrefcount not supported on this platformN(
   R   t   sysR1   R   R7   R*   R   R   R   RW   (   R   R   R&   R   t   count1R   t   count2(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt    test_decorateTestSuiteReferencesy  s    	c         C   sz   t  j   } t  j t  j | g  g  } t  j | t  j  } t  j t  j t  j |  g  g  } |  j | |  d S(   s   
        Calling L{decorate} on a test suite with nested suites will return a
        test suite that maintains the same structure, but with all tests
        decorated.
        N(   R   R*   R   R   R   R   (   R   R&   R   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_decorateNestedTestSuite  s    !c         C   sS   t  j   } t  j | t  j  } t  j | t  j  } |  j | t  j |   d S(   s   
        Calling L{decorate} on a test suite with already-decorated tests
        decorates all of the tests in the suite again.
        N(   R   R*   R   R   R   (   R   R&   R   t   redecoratedTest(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_decorateDecoratedSuite  s    		c         C   s\   t  j   } t j | g  } t  j | t  j  } |  j | t j t  j |  g   d S(   s   
        Tests can be in non-standard suites. L{decorate} preserves the
        non-standard suites when it decorates the tests.
        N(   R   R*   R   t   DestructiveTestSuiteR   R   R   (   R   R&   R   t	   decorated(    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_decoratePreservesSuite  s    (   R   R   R3   R   R   R   R   R   R   R   R   R   R   R  (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR     s   					
					t   TestMonkeyPatchSupportc           B   sD   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   sF   
    Tests for the patch() helper method in L{unittest.TestCase}.
    c         C   s1   d |  _  d |  _ |  j  |  _ t j   |  _ d  S(   Nt   originalt   patched(   t   originalValuet   patchedValuet   objectToPatchR   R*   R&   (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR      s    		c         C   s3   |  j  j |  d |  j  |  j |  j |  j  d S(   si   
        Calling C{patch()} on a test monkey patches the specified object and
        attribute.
        R	  N(   R&   t   patchR  R"   R	  (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt
   test_patch  s    c         C   sI   |  j  j |  d |  j  |  j  j t j    |  j |  j |  j  d S(   sw   
        Any monkey patches introduced by a test using C{patch()} are reverted
        after the test has run.
        R	  N(	   R&   R
  R  R(   R   R{   R"   R	  R  (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_patchRestoredAfterRun  s    c         C   s?   |  j  j |  d |  j  } | j   |  j |  j |  j  d S(   s   
        C{patch()} return a L{monkey.MonkeyPatcher} object that can be used to
        restore the original values before the end of the test.
        R	  N(   R&   R
  R  t   restoreR"   R	  R  (   R   R
  (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_revertDuringTest  s    
c         C   sI   |  j  j |  d |  j  } | j   | j   |  j |  j |  j  d S(   sq   
        The returned L{monkey.MonkeyPatcher} object can re-apply the patch
        during the test run.
        R	  N(   R&   R
  R  R  R"   R	  (   R   R
  (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_revertAndRepatch  s    

c         C   s   |  j  j |  d |  j  |  j |  j |  j  |  j  j |  d d  |  j |  j d  |  j  j t j    |  j |  j |  j  d S(   sW   
        Successive patches are applied and reverted just like a single patch.
        R	  s   second valueN(	   R&   R
  R  R"   R	  R(   R   R{   R  (   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_successivePatches  s    (	   R   R   R3   R    R  R  R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR    s   				
	
	t   TestIterateTestsc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s]   
    L{_iterateTests} returns a list of all test cases in a test suite or test
    case.
    c         C   s2   t  j   } |  j | g t t  j |    d S(   sj   
        L{_iterateTests} on a single test case returns a list containing that
        test case.
        N(   R   R*   R"   t   listt   _iterateTests(   R   R&   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_iterateTestCase  s    c         C   sD   t  j   } t j | g  } |  j | g t t  j |    d S(   s   
        L{_iterateTests} on a test suite that contains a single test case
        returns a list containing that test case.
        N(   R   R*   R   R   R"   R  R  (   R   R&   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_iterateSingletonTestSuite  s    c         C   sP   t  j   } t j t j | g  g  } |  j | g t t  j |    d S(   sP   
        L{_iterateTests} returns tests that are in nested test suites.
        N(   R   R*   R   R   R"   R  R  (   R   R&   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   test_iterateNestedTestSuite  s    c         C   sV   t  j   } t j t j | g  |  g  } |  j | |  g t t  j |    d S(   sU   
        L{_iterateTests} returns tests in left-to-right, depth-first order.
        N(   R   R*   R   R   R"   R  R  (   R   R&   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt#   test_iterateIsLeftToRightDepthFirst  s    !(   R   R   R3   R  R  R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyR    s
   			
		(    (    (&   R3   R.   R|   R   R,   t   twisted.internetR    R   t   twisted.trialR   R   R   R   R   R   R   t    twisted.trial.test.test_reporterR   R	   R*   R   R4   RM   RZ   Rh   Rl   Rz   R   R   R   R   R   R   R   R   R   R  R  (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_tests.pyt   <module>   s0   0":5>,,=& Q&*%B