Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/testfixtures/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/testfixtures/__pycache__/shouldwarn.cpython-311.pyc

�

�܋f����ddlZddlmZmZddlmZmZeeeefZ	Gd�dej
��ZGd�de��ZdS)�N)�Union�Type)�
Comparison�comparec�@��eZdZdZdZdef�fd�Z�fd�Z�fd�Z�xZ	S)�
ShouldWarna 
    This context manager is used to assert that warnings are issued
    within the context it is managing.

    :param expected: This should be a sequence made up of one or more elements,
                     each of one of the following types:

                     * A warning class, indicating that the type
                       of the warnings is important but not the
                       parameters it is created with.

                     * A warning instance, indicating that a
                       warning exactly matching the one supplied
                       should have been issued.

                     If no expected warnings are passed, you will need to inspect
                     the contents of the list returned by the context manager.

    :param filters:
      If passed, these are used to create a filter such that only warnings you
      are interested in will be considered by this :class:`ShouldWarn`
      instance. The names and meanings are the same as the parameters for
      :func:`warnings.filterwarnings`.

    F�expectedc���tt|���d���d�|D��|_||_dS)NT)�recordc�,�g|]}t|����S�)�C)�.0�es  �h/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/testfixtures/shouldwarn.py�
<listcomp>z'ShouldWarn.__init__.<locals>.<listcomp>)s��0�0�0�!��1���0�0�0�)�superr�__init__r	�filters)�selfr	r�	__class__s   �rrzShouldWarn.__init__'sD���
�j�$���(�(��(�5�5�5�0�0�x�0�0�0��
�����rc���tt|�����|_t	jdi|j��|jS)N�always)r)rr�	__enter__�recorded�warnings�filterwarningsr�rrs �rrzShouldWarn.__enter__,sA����j�$�/�/�9�9�;�;��
���9�9�D�L�9�9�9��}�rc����tt|���|||��|js	|jrdS|js|jr	|jsdSt
|jd�|jD�����dS)Nc��g|]	}|j��
Sr
)�message)r�wms  rrz'ShouldWarn.__exit__.<locals>.<listcomp>7s��&J�&J�&J�b�r�z�&J�&J�&Jr)�actual)rr�__exit__r�_empty_okayr	r)r�exc_type�exc_val�exc_tbrs    �rr%zShouldWarn.__exit__1s����
�j�$���(�(��7�F�C�C�C��}�	��!1�	��F��}�	���	�t�7G�	��F���
�&J�&J�D�M�&J�&J�&J�K�K�K�K�K�Kr)
�__name__�
__module__�__qualname__�__doc__r&�
WarningOrTyperrr%�
__classcell__�rs@rrr
s����������4�K��-�������
�����
L�L�L�L�L�L�L�L�Lrrc�&��eZdZdZdZ�fd�Z�xZS)�
ShouldNotWarnzs
    This context manager is used to assert that no warnings are issued
    within the context it is managing.
    Tc�V��tt|�����dS)N)rr2rrs �rrzShouldNotWarn.__init__Bs%���
�m�T�"�"�+�+�-�-�-�-�-r)r*r+r,r-r&rr/r0s@rr2r2:sI���������
�K�.�.�.�.�.�.�.�.�.rr2)
r�typingrr�testfixturesrrr�Warningr.�catch_warningsrr2r
rr�<module>r8s���������������1�1�1�1�1�1�1�1��g�t�G�}�,�-�
�-L�-L�-L�-L�-L��(�-L�-L�-L�`	.�	.�	.�	.�	.�J�	.�	.�	.�	.�	.r

Hacked By AnonymousFox1.0, Coded By AnonymousFox