Ë
    ojÍ  ã            	       ó¢  — d 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	 ddl
mZ ddlmZmZ ddlmZ  G d„ d	ej"                  «      Z e	ej$                  «       G d
„ d ej&                  ej$                  d«      «      «       Zd„ Zd„ Z G d„ de«      Z G d„ de«      Z G d„ de«      Z ej4                  eej6                  ej$                  «        ej4                  eej8                  ej$                  «        eedd«      Zer ej4                  eeej$                  «       deej6                  ej"                  f   deej$                     fd„Zy)z-
Infrastructure for test running and suites.
é    N)ÚIteratorÚUnion)Úimplementer)Ú
components)ÚitrialÚreporter)Ú_logObserverc                   ó   — e Zd ZdZd„ Zy)Ú	TestSuitezh
    Extend the standard library's C{TestSuite} with a consistently overrideable
    C{run} method.
    c                 óV   — | j                   D ]  }|j                  r |S  ||«       Œ |S )z;
        Call C{run} on every member of the suite.
        )Ú_testsÚ
shouldStop)ÚselfÚresultÚtests      ú</usr/lib/python3/dist-packages/twisted/trial/_asyncrunner.pyÚrunzTestSuite.run   s8   € ð —K‘Kò 	ˆDØ× Ò Øàˆñ ��Lð	ð ˆó    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   © r   r   r   r      s   „ ñó
r   r   c                   ó   — e Zd ZdZd„ Zd„ Zy)ÚTestDecoratorz—
    Decorator for test cases.

    @param _originalTest: The wrapped instance of test.
    @type _originalTest: A provider of L{itrial.ITestCase}
    c                 ó$   — | j                  |«      S ©zQ
        Run the unit test.

        @param result: A TestResult object.
        )r   ©r   r   s     r   Ú__call__zTestDecorator.__call__4   s   € ð �x‰x˜ÓÐr   c                 ót   — | j                   j                  t        j                  || j                  «      «      S r   )Ú_originalTestr   r   Ú_AdaptedReporterÚ	__class__r   s     r   r   zTestDecorator.run<   s,   € ð ×!Ñ!×%Ñ%¤h×&?Ñ&?ÀÈÏÉÓ&WÓXÐXr   N)r   r   r   r   r    r   r   r   r   r   r   '   s   „ ñò óYr   r   r"   c                 ó   — g | _         y)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   € ð €E…Lr   c                 ó¦   — 	 t        | «      }t        | «       |D ]  }| j                  t	        ||«      «       Œ | S # t        $ r  || «      cY S w xY w)a2  
    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   r,   r,   P   s\   € ð$Ü�T“
ˆô
 �Ôàò 0ˆØ�‰”X˜d IÓ.Õ/ð0à€Køô ò Ù˜‹Òðús   ‚< ¼AÁAc                   ó   — e Zd ZdZy)Ú_PyUnitTestCaseAdapterz2
    Adapt from pyunit.TestCase to ITestCase.
    N)r   r   r   r   r   r   r   r1   r1   o   s   „ òr   r1   c                   ó   — e Zd ZdZd„ Zy)Ú_BrokenIDTestCaseAdapterz£
    Adapter for pyunit-style C{TestCase} subclasses that have undesirable id()
    methods. That is C{unittest.FunctionTestCase} and C{unittest.DocTestCase}.
    c                 ór   — | j                   j                  «       }|�|S | j                   j                  «       S )zH
        Return the fully-qualified Python name of the doctest.
        )r"   ÚshortDescriptionÚid)r   ÚtestIDs     r   r6   z_BrokenIDTestCaseAdapter.id{   s8   € ð ×#Ñ#×4Ñ4Ó6ˆØÐØˆMØ×!Ñ!×$Ñ$Ó&Ð&r   N)r   r   r   r   r6   r   r   r   r3   r3   u   s   „ ñó
'r   r3   c                   ó   — e Zd ZdZd„ Zy)Ú _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                 óN  — t        j                  «        t        j                  | |«       t	        j
                  «        t        j                  «        t	        j                  «       D ]  }|j                  | |«       Œ t	        j                  «        t	        j                  «        y )N)
ÚgcÚcollectr   r   r	   Ú_addÚ	getErrorsÚaddErrorÚflushErrorsÚ_remove)r   r   Úerrors      r   r   z$_ForceGarbageCollectionDecorator.runŒ   sn   € Ü
�
‰
ŒÜ×Ñ˜$ Ô'Ü×ÑÔÜ
�
‰
ŒÜ!×+Ñ+Ó-ò 	)ˆEØ�O‰O˜D %Õ(ð	)ä× Ñ Ô"Ü×ÑÕr   Nr   r   r   r   r9   r9   …   s   „ ñór   r9   ÚDocTestCaseÚtestSuiteOrCaseÚreturnc              #   ó‚   K  — 	 t        | «      }|D ]  }t        |«      E d{  –—†  Œ y7 Œ# t        $ r | –— Y yw xY w­w)zF
    Iterate through all of the test cases in C{testSuiteOrCase}.
    N)r)   Ú_iterateTestsr*   )rD   r&   r   s      r   rG   rG   ¤   sM   è ø€ ð+Ü�_Ó%ˆð ò 	+ˆDÜ$ TÓ*×*Ñ*ñ	+Ø*ùô	 ò ØÔðüs$   ‚?„, �?¢*£?¬<¹?»<¼?) r   Údoctestr;   ÚunittestÚpyunitÚtypingr   r   Úzope.interfacer   Útwisted.pythonr   Útwisted.trialr   r   Útwisted.trial._synctestr	   r   Ú	ITestCaseÚproxyForInterfacer   r'   r,   r1   r3   r9   ÚregisterAdapterÚTestCaseÚFunctionTestCaseÚgetattrÚ_docTestCaserG   r   r   r   ú<module>rW      sO  ðñ
ó
 Û 	Û ß "å &å %ß *Ý 0ô�× Ñ ô ñ" ˆV×ÑÓôYØ €J× Ñ Ø×Ñ˜/óóYó ðYò:òô>˜]ô ô'Ð5ô 'ô  }ô ð$ €
× Ñ Ð1°6·?±?ÀF×DTÑDTÔ Uð €
× Ñ Ø˜f×5Ñ5°v×7GÑ7Gôñ
 �w ¨tÓ4€ÙØ€J×ÑÐ7¸Àv×GWÑGWÔXð+Ø˜6Ÿ?™?¨F×,<Ñ,<Ð<Ñ=ð+àˆf×ÑÑô+r   