%PDF- %PDF-
Mini Shell

Mini Shell

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

�

Ϫ�f��t�dZddlZddlmZddlmZddlmZGd�d�ZGd�d	eej�Z
y)
z2
Tests for warning suppression features of Trial.
�N)�namedAny)�unittest)�suppressionc�F�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�SuppressionMixinzj
    Tests for the warning suppression features of
    L{twisted.trial.unittest.SynchronousTestCase}.
    c�J�|jtj��y)N)�run�pyunit�
TestResult)�self�suites  �E/usr/lib/python3/dist-packages/twisted/trial/test/test_suppression.py�runTestszSuppressionMixin.runTestss��
�	�	�&�#�#�%�&�c�:�tj||�g�S)z�
        Return a new L{unittest.TestSuite} with a single test method in it.

        @param cls: A L{TestCase} subclass defining a test method.

        @param methodName: The name of the test method from C{cls}.
        )r
�	TestSuite)r�cls�
methodNames   r�_loadzSuppressionMixin._loads������Z�� 1�2�2rc�T�|j|D�cgc]}|d��	c}|�ycc}w)a&
        Assert that a certain number of warnings with certain messages were
        emitted in a certain order.

        @param warnings: A list of emitted warnings, as returned by
            C{flushWarnings}.

        @param which: A list of strings giving warning messages that should
            appear in C{warnings}.

        @raise self.failureException: If the warning messages given by C{which}
            do not match the messages in the warning information in C{warnings},
            or if they do not appear in the same order.
        �messageN)�assertEqual)r�warnings�which�warnings    r�_assertWarningsz SuppressionMixin._assertWarnings#s'��	
���H�E��'�)�,�E�u�M��Es�%c�B�|j|j|jd��|j|jjg�}|j|tjtjtjtjg�y)z�
        Suppressions defined by the test method being run are applied to any
        warnings emitted while running the C{setUp} fixture.
        �testSuppressMethodN)	rr�TestSetUpSuppression�
flushWarnings�_emitrr�CLASS_WARNING_MSG�MODULE_WARNING_MSG�r�
warningsShowns  r�test_setUpSuppressionz&SuppressionMixin.test_setUpSuppression4s{��
	
�
�
�d�j�j��!:�!:�<P�Q�R��*�*�D�,E�,E�,K�,K�+L�M�
������-�-��.�.��-�-��.�.�	
�	
rc�B�|j|j|jd��|j|jjg�}|j|tjtjtjtjg�y)z�
        Suppressions defined by the test method being run are applied to any
        warnings emitted while running the C{tearDown} fixture.
        rN)	rr�TestTearDownSuppressionr r!rrr"r#r$s  r�test_tearDownSuppressionz)SuppressionMixin.test_tearDownSuppressionEs{��
	
�
�
�d�j�j��!=�!=�?S�T�U��*�*�D�,H�,H�,N�,N�+O�P�
������-�-��.�.��-�-��.�.�	
�	
rc��|j|j|jd��|j|jjg�}|j|tjtjg�y)z�
        A suppression set on a test method prevents warnings emitted by that
        test method which the suppression matches from being emitted.
        rN)	rr�TestSuppressionr r!rrr"r#r$s  r�test_suppressMethodz$SuppressionMixin.test_suppressMethodVsf��
	
�
�
�d�j�j��!5�!5�7K�L�M��*�*�D�,@�,@�,F�,F�+G�H�
�����
�
*�
*�K�,J�,J�K�	
rc�t�|j|j|jd��|j|jjg�}|j|ddtj�|j|ddtj�|jt|�d�y)z�
        A suppression set on a L{SynchronousTestCase} subclass prevents warnings
        emitted by any test methods defined on that class which match the
        suppression from being emitted.
        �testSuppressClassrr��N)
rrr+r r!rr�METHOD_WARNING_MSGr#�lenr$s  r�test_suppressClassz#SuppressionMixin.test_suppressClassbs���	
�
�
�d�j�j��!5�!5�7J�K�L��*�*�D�,@�,@�,F�,F�+G�H�
�����q�)�)�4�k�6T�6T�U�����q�)�)�4�k�6T�6T�U�����]�+�Q�/rc�t�|j|j|jd��|j|jj
g�}|j
|ddtj�|j
|ddtj�|j
t|�d�y)z�
        A suppression set on a module prevents warnings emitted by any test
        mewthods defined in that module which match the suppression from being
        emitted.
        �testSuppressModulerrr/r0N)rr�TestSuppression2r r+r!rrr1r"r2r$s  r�test_suppressModulez$SuppressionMixin.test_suppressModulens���	
�
�
�d�j�j��!6�!6�8L�M�N��*�*�D�,@�,@�,F�,F�+G�H�
�����q�)�)�4�k�6T�6T�U�����q�)�)�4�k�6S�6S�T�����]�+�Q�/rc��|j|j|jd��|j|jjg�}|j|ddtj�|j|ddtj�|j|ddtj�|jt|�d�y)z�
        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.
        �testOverrideSuppressClassrrr/r0�N)rrr+r r!rrr1r"r#r2r$s  r�test_overrideSuppressClassz+SuppressionMixin.test_overrideSuppressClasszs���	
�
�
�d�j�j��!5�!5�7R�S�T��*�*�D�,@�,@�,F�,F�+G�H�
�����q�)�)�4�k�6T�6T�U�����q�)�)�4�k�6S�6S�T�����q�)�)�4�k�6T�6T�U�����]�+�Q�/rN)
�__name__�
__module__�__qualname__�__doc__rrrr&r)r,r3r7r;�rrrrs5���
'�3�N�"
�"
�"

�
0�
0�0rrc�P�eZdZdZed�Zed�Zed�Zed�Zy)�SynchronousSuppressionTestsz0
    @see: L{twisted.trial.test.test_tests}
    z>twisted.trial.test.suppression.SynchronousTestSetUpSuppressionzAtwisted.trial.test.suppression.SynchronousTestTearDownSuppressionz9twisted.trial.test.suppression.SynchronousTestSuppressionz:twisted.trial.test.suppression.SynchronousTestSuppression2N)	r<r=r>r?rrr(r+r6r@rrrBrB�sF���$�H���'�K����C��O� �D��rrB)r?rr
�twisted.python.reflectr�
twisted.trial�twisted.trial.testrr�SynchronousTestCaserBr@rr�<module>rGs:���
�+�"�*�u0�u0�p�"2�H�4P�4P�r

Zerion Mini Shell 1.0