+
    Dfj              	       `   R t ^ RIt^ RIt^ RIt^ RIHtHt ^ RIH	t	 ^ RI
Ht ^ RIHtHt ^ RIHt  ! R R]P"                  4      t]	! ]P$                  4       ! R	 R
]P&                  ! ]P$                  R4      4      4       tR tR t ! R R]4      t ! R R]4      t ! R R]4      t]P4                  ! ]]P6                  ]P$                  4       ]P4                  ! ]]P8                  ]P$                  4       ]! ]RR4      t]'       d   ]P4                  ! ]]]P$                  4       R R ltR# )z-
Infrastructure for test running and suites.
N)IteratorUnion)implementer)
components)itrialreporter)_logObserverc                   *   a  ] tR t^t o RtR tRtV tR# )	TestSuitez\
Extend the standard library's C{TestSuite} with a consistently overrideable
C{run} method.
c                f    V P                    F   pVP                  '       d    V# V! V4       K"  	  V# )z+
Call C{run} on every member of the suite.
)_tests
shouldStop)selfresulttests   && </usr/lib/python3/dist-packages/twisted/trial/_asyncrunner.pyrunTestSuite.run   s6     KKD    L        N__name__
__module____qualname____firstlineno____doc__r   __static_attributes____classdictcell____classdict__s   @r   r
   r
      s     
 r   r
   c                   0   a  ] tR t^'t o RtR tR tRtV tR# )TestDecoratorz
Decorator for test cases.

@param _originalTest: The wrapped instance of test.
@type _originalTest: A provider of L{itrial.ITestCase}
c                $    V P                  V4      # z9
Run the unit test.

@param result: A TestResult object.
)r   r   r   s   &&r   __call__TestDecorator.__call__4   s     xxr   c                t    V P                   P                  \        P                  ! WP                  4      4      # r#   )_originalTestr   r   _AdaptedReporter	__class__r$   s   &&r   r   TestDecorator.run<   s*     !!%%h&?&?&WXXr   r   N)	r   r   r   r   r   r%   r   r   r   r   s   @r   r!   r!   '   s      Y Yr   r!   r(   c                    . V n         R# )z
Clear all tests from C{suite}.

This messes with the internals of C{suite}. In particular, it assumes that
the suite keeps all of its tests in a list in an instance variable called
C{_tests}.
N)r   )suites   &r   _clearSuiter.   E   s     ELr   c                     \        V 4      p\        T 4       T F  pT P                  \	        Y14      4       K  	  T #   \         d    T! T 4      u # i ; i)a
  
Decorate all test cases in C{test} with C{decorator}.

C{test} can be a test case or a test suite. If it is a test suite, then the
structure of the suite is preserved.

L{decorate} tries to preserve the class of the test suites it finds, but
assumes the presence of the C{_tests} attribute on the suite.

@param test: The C{TestCase} or C{TestSuite} to decorate.

@param decorator: A unary callable used to decorate C{TestCase}s.

@return: A decorated C{TestCase} or a C{TestSuite} containing decorated
    C{TestCase}s.
)iter	TypeErrorr.   addTestdecorate)r   	decoratortestscases   &&  r   r3   r3   P   sU    $T

 Xd./ K  s   = AAc                       ] tR t^otRtRtR# )_PyUnitTestCaseAdapterz*
Adapt from pyunit.TestCase to ITestCase.
r   N)r   r   r   r   r   r   r   r   r   r8   r8   o   s    r   r8   c                   *   a  ] tR t^ut o RtR tRtV tR# )_BrokenIDTestCaseAdapterz
Adapter for pyunit-style C{TestCase} subclasses that have undesirable id()
methods. That is C{unittest.FunctionTestCase} and C{unittest.DocTestCase}.
c                v    V P                   P                  4       pVe   V# V P                   P                  4       # )z8
Return the fully-qualified Python name of the doctest.
)r(   shortDescriptionid)r   testIDs   & r   r=   _BrokenIDTestCaseAdapter.id{   s8     ##446M!!$$&&r   r   N)r   r   r   r   r   r=   r   r   r   s   @r   r:   r:   u   s     
' 'r   r:   c                   *   a  ] tR t^t o RtR tRtV tR# ) _ForceGarbageCollectionDecoratorz
Forces garbage collection to be run before and after the test. Any errors
logged during the post-test collection are added to the test result as
errors.
c                \   \         P                  ! 4        \        P                  W4       \        P
                  ! 4        \         P                  ! 4        \        P                  ! 4        F  pVP                  W4       K  	  \        P                  ! 4        \        P                  ! 4        R # )N)
gccollectr!   r   r   _add	getErrorsaddErrorflushErrors_remove)r   r   errors   && r   r   $_ForceGarbageCollectionDecorator.run   se    


$'


!++-EOOD( .  "r   r   Nr   r   s   @r   rA   rA      s      r   rA   DocTestCasec                    V ^8  d   QhR\         \        P                  \        P                  3,          R\        \
        P                  ,          /# )   testSuiteOrCasereturn)r   pyunitTestCaser
   r   r   	ITestCase)formats   "r   __annotate__rU      s;     + +6??F,<,<<=+f+r   c              #     "    \        V 4      pV F  p\        V4       Rj  xL
  K  	  R#  L
  \         d	    T x   R# i ; i5i)z>
Iterate through all of the test cases in C{testSuiteOrCase}.
N)r0   _iterateTestsr1   )rO   r-   r   s   &  r   rW   rW      sG     +_% D$T*** *	  s-   A/ A-AAAAA) r   doctestrC   unittestrQ   typingr   r   zope.interfacer   twisted.pythonr   twisted.trialr   r   twisted.trial._synctestr   r
   rS   proxyForInterfacer!   r.   r3   r8   r:   rA   registerAdapterrR   FunctionTestCasegetattr_docTestCaserW   r   r   r   <module>rd      s  

  	  " & % * 0   " VY  /Y Y:>] '5 ' } $   16??FDTDT U   f55v7G7G
 wt47vGWGWX+r   