%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/trial/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/trial/__pycache__/_asyncrunner.cpython-312.pyc

�

Ϫ�f��	��dZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
mZddlmZGd�d	ej"�Ze	e
j$�Gd
�dej&e
j$d���Zd
�Zd�ZGd�de�ZGd�de�ZGd�de�Zej4eej6e
j$�ej4eej8e
j$�eedd�Zerej4eee
j$�deej6ej"fdee
j$fd�Zy)z-
Infrastructure for test running and suites.
�N)�Iterator�Union)�implementer)�
components)�itrial�reporter)�_logObserverc��eZdZdZd�Zy)�	TestSuitezh
    Extend the standard library's C{TestSuite} with a consistently overrideable
    C{run} method.
    c�V�|jD]}|jr|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.runs8���K�K�	�D�� � ���
�
��L�	��
�N��__name__�
__module__�__qualname__�__doc__r�rrrrs���
rrc��eZdZdZd�Zd�Zy)�
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�rrs  r�__call__zTestDecorator.__call__4s���x�x���rc�t�|jjtj||j��Sr)�
_originalTestrr�_AdaptedReporter�	__class__rs  rrzTestDecorator.run<s,���!�!�%�%�h�&?�&?�����&W�X�XrN)rrrrr rrrrrr's��� �Yrrr"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'Es���E�Lrc��	t|�}t|�|D]}|jt	||���|S#t$r||�cYSwxYw)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    rr,r,Ps\��$��T�
��
����0�����X�d�I�.�/�0��K���������s�<�A�Ac��eZdZdZy)�_PyUnitTestCaseAdapterz2
    Adapt from pyunit.TestCase to ITestCase.
    N)rrrrrrrr1r1os��rr1c��eZdZdZd�Zy)�_BrokenIDTestCaseAdapterz�
    Adapter for pyunit-style C{TestCase} subclasses that have undesirable id()
    methods. That is C{unittest.FunctionTestCase} and C{unittest.DocTestCase}.
    c�r�|jj�}|�|S|jj�S)zH
        Return the fully-qualified Python name of the doctest.
        )r"�shortDescription�id)r�testIDs  rr6z_BrokenIDTestCaseAdapter.id{s8���#�#�4�4�6�����M��!�!�$�$�&�&rN)rrrrr6rrrr3r3us���
'rr3c��eZdZdZd�Zy)� _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�tj�tj||�t	j
�tj�t	j�D]}|j||��t	j�t	j�y)N)
�gc�collectrrr	�_add�	getErrors�addError�flushErrors�_remove)rr�errors   rrz$_ForceGarbageCollectionDecorator.run�sn��
�
�
�����$��'�����
�
�
��!�+�+�-�	)�E��O�O�D�%�(�	)�� � �"����rNrrrrr9r9�s���rr9�DocTestCase�testSuiteOrCase�returnc#�K�	t|�}|D]}t|�Ed{����y7�#t$r|��YywxYw�w)zF
    Iterate through all of the test cases in C{testSuiteOrCase}.
    N)r)�
_iterateTestsr*)rDr&rs   rrGrG�sM����+��_�%���	+�D�$�T�*�*�*�	+�*��	�����s$�?�,�?�*�?�
<�?�<�?) r�doctestr;�unittest�pyunit�typingrr�zope.interfacer�twisted.pythonr�
twisted.trialrr�twisted.trial._synctestr	r�	ITestCase�proxyForInterfacerr'r,r1r3r9�registerAdapter�TestCase�FunctionTestCase�getattr�_docTestCaserGrrr�<module>rWsO��
�
�	��"�&�%�*�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

Zerion Mini Shell 1.0