????

Your IP : 3.147.70.194


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/__pycache__/outcomes.cpython-311.pyc

�

�܋f(��h�dZddlZddlZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	lm
Z
dd
lmZdZ
e
rddlmZndd
lmZeZGd�de��ZeefZGd�de��ZGd�de��ZGd�de��Ze
dedef���Ze
de	e���ZGd�deeef��Zdedeegeeefffd�Zee��	d3dd �d!ed"eed#eedefd$���Zee��	d4ddd%�d!ed&e d#eedefd'���Z!ee��d5d!ed)e d#eedefd*���Z"	d6d+ed!ed#eedefd,�Z#Gd-�d.e��Z$ee$��d4d!edefd/���Z%	d7d0ed1eed!eedefd2�Z&dS)8zZException classes and constants handling test outcomes as well as
functions creating them.�N)�Any)�Callable)�cast)�NoReturn)�Optional)�Type)�TypeVar)�KEYWORD_MSG_ARGF)�Protocol)�Genericc�N��eZdZdZd	deededdf�fd�
Zdefd�ZeZ	�xZ
S)
�OutcomeExceptionzmOutcomeException and its subclass instances indicate and contain info
    about test and collection outcomes.NT�msg�pytrace�returnc�&��|�^t|t��sId}t|�t	|��jt	|��j�����t
���|��||_||_	dS)NzY{} expected string as 'msg' parameter, got '{}' instead.
Perhaps you meant to use a mark?)
�
isinstance�str�	TypeError�format�type�__name__�super�__init__rr)�selfrr�	error_msg�	__class__s    ��a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/_pytest/outcomes.pyrzOutcomeException.__init__ s|����?�:�c�3�#7�#7�?�3�
��I�,�,�T�$�Z�Z�-@�$�s�)�)�BT�U�U�V�V�V�
�����������������c�>�|j�|jSd|jj�d�S)N�<z
 instance>)rrr)rs r�__repr__zOutcomeException.__repr__+s'���8���8�O�6�4�>�*�6�6�6�6r)NT)r�
__module__�__qualname__�__doc__rr�boolrr"�__str__�
__classcell__�rs@rrrs{�������+�+�	�	�H�S�M�	�4�	�4�	�	�	�	�	�	�7�#�7�7�7�7�
�G�G�G�G�Grrc�R��eZdZdZ			ddd�deededed	ed
df
�fd�Z�xZS)
�Skipped�builtinsNTF)�_use_item_locationrr�allow_module_levelr-rc�j��t���||���||_||_dS)N�rr)rrr.r-)rrrr.r-rs     �rrzSkipped.__init__;s:���	�����S�'��2�2�2�"4���#5����r)NTF)rr#r$rrr&rr(r)s@rr+r+6s���������J�"��#(�	5�$)�
5�5�5�
�c�]�5��5�!�	5�!�
5�
�5�5�5�5�5�5�5�5�5�5rr+c��eZdZdZdZdS)�Failedz.Raised from an explicit call to pytest.fail().r,N�rr#r$r%�rrr2r2Js������8�8��J�J�Jrr2c�@��eZdZdZ	ddedeeddf�fd�
Z�xZS)	�Exitz=Raised for immediate program exits (no tracebacks/summaries).�unknown reasonNr�
returncoderc�f��||_||_t���|��dS�N)rr8rr)rrr8rs   �rrz
Exit.__init__Ss1������$���
����������r)r7N)	rr#r$r%rr�intrr(r)s@rr6r6Psk�������G�G�HL�����7?��}��	
����������rr6�_F.)�bound�_ETc�$�eZdZUeed<eed<dS)�_WithException�	Exception�__call__N)rr#r$r>�__annotations__r<r4rrr@r@bs"��������N�N�N��L�L�L�L�Lrr@�exception_typerc�T��dtdtttff�fd�}|S)N�funcrc�d��ttttf|��}�|_|Sr:)rr@r<r>rA)rF�func_with_exceptionrDs  �r�decoratez!_with_exception.<locals>.decoratehs+���"�>�"�c�'�#:�D�A�A��(6��%�"�"r)r<r@r>)rDrIs` r�_with_exceptionrJgs?���#�r�#�n�R��W�5�#�#�#�#�#�#�
�Or�)r�reasonr8rc���d}ddlm}|r
|r|d���|s8|�|d���tjt	jd���d	�
��|}t
||���)axExit testing process.

    :param reason:
        The message to show as the reason for exiting pytest.  reason has a default value
        only because `msg` is deprecated.

    :param returncode:
        Return code to be used when exiting pytest.

    :param msg:
        Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead.
    Tr��
UsageErrorzHcannot pass reason and msg to exit(), `msg` is deprecated, use `reason`.Nz!exit() requires a reason argument�exit�rF���
stacklevel)�_pytest.configrO�warnings�warnr
rr6)rLr8r�__tracebackhide__rOs     rrPrPss��� ��)�)�)�)�)�)�
�
�#�
��j�V�
�
�	
����;��*�@�A�A�A��
�o�,�&�9�9�9�a�H�H�H�H���
�v�z�
"�
"�"r)r.rr.c�J�d}td||��}t||����)a`Skip an executing test with the given message.

    This function should be called only during testing (setup, call or teardown) or
    during collection by using the ``allow_module_level`` flag.  This function can
    be called in doctests as well.

    :param reason:
        The message to show the user as reason for the skip.

    :param allow_module_level:
        Allows this function to be called at module level.
        Raising the skip exception at module level will stop
        the execution of the module and prevent the collection of all tests in the module,
        even those defined before the `skip` call.

        Defaults to False.

    :param msg:
        Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead.

    .. note::
        It is better to use the :ref:`pytest.mark.skipif ref` marker when
        possible to declare a test to be skipped under certain conditions
        like mismatching platforms or dependencies.
        Similarly, use the ``# doctest: +SKIP`` directive (see :py:data:`doctest.SKIP`)
        to skip a doctest statically.
    T�skip)rr.)�_resolve_msg_to_reasonr+)rLr.rrXs    rrZrZ�s/��>��
#�F�F�C�
8�
8�F�
�f�1C�
D�
D�
D�DrTrc�J�d}td||��}t||����)a�Explicitly fail an executing test with the given message.

    :param reason:
        The message to show the user as reason for the failure.

    :param pytrace:
        If False, msg represents the full failure information and no
        python traceback will be reported.

    :param msg:
        Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead.
    T�failr0)r[r2)rLrrrXs    rr]r]�s.����
#�F�F�C�
8�
8�F�
�V�W�
-�
-�
-�-r�	func_namec��d}|�B|rddlm}|d|�d����tjt	j|���d�	��|}|S)
a�
    Handles converting the deprecated msg parameter if provided into
    reason, raising a deprecation warning.  This function will be removed
    when the optional msg argument is removed from here in future.

    :param str func_name:
        The name of the offending function, this is formatted into the deprecation message.

    :param str reason:
        The reason= passed into either pytest.fail() or pytest.skip()

    :param str msg:
        The msg= passed into either pytest.fail() or pytest.skip().  This will
        be converted into reason if it is provided to allow pytest.skip(msg=) or
        pytest.fail(msg=) to continue working in the interim period.

    :returns:
        The value to use as reason.

    TNrrNz.Passing both ``reason`` and ``msg`` to pytest.z(...) is not permitted.rQ�rS)�pytestrOrVrWr
r)r^rLrrXrOs     rr[r[�sz��.��
���	�)�)�)�)�)�)��*�c��c�c�c���
�	�
�o�,�)�<�<�<��K�K�K�K����Mrc��eZdZdZdS)�XFailedz/Raised from an explicit call to pytest.xfail().Nr3r4rrrcrc�s������9�9�9�9rrcc�$�d}t|���)a�Imperatively xfail an executing test or setup function with the given reason.

    This function should be called only during testing (setup, call or teardown).

    :param reason:
        The message to show the user as reason for the xfail.

    .. note::
        It is better to use the :ref:`pytest.mark.xfail ref` marker when
        possible to declare a test to be xfailed under certain conditions
        like known bugs or missing features.
    T)rc)rLrXs  r�xfailre�s����
�&�/�/�r�modname�
minversionc���ddl}d}t|dd��|j��5|jd��	t	|��n.#t
$r!}|�d|�d|��}t
|d�	��d�d}~wwxYw	ddd��n#1swxYwYtj|}|�|St|d
d��}|�:ddl
m}|�||��||��krt
d|�d
|�d|��d�	���|S)avImport and return the requested module ``modname``, or skip the
    current test if the module cannot be imported.

    :param modname:
        The name of the module to import.
    :param minversion:
        If given, the imported module's ``__version__`` attribute must be at
        least this minimal version, otherwise the test is still skipped.
    :param reason:
        If given, this reason is shown as the message when the module cannot
        be imported.

    :returns:
        The imported module. This should be assigned to its canonical name.

    Example::

        docutils = pytest.importorskip("docutils")
    rNTrK�eval�ignorezcould not import z: )r.�__version__)�Versionzmodule z has __version__ z, required is: )rV�compile�catch_warnings�simplefilter�
__import__�ImportErrorr+�sys�modules�getattr�packaging.versionrl)	rfrgrLrVrX�exc�mod�verattrrls	         r�importorskiprys���,�O�O�O����G�R�� � � �	 ��	 �	"�	"�
E�
E�	���h�'�'�'�	E��w�������	E�	E�	E��~�?�W�?�?�#�?�?���&�T�:�:�:��D�����	E����
 �
E�
E�
E�
E�
E�
E�
E�
E�
E�
E�
E����
E�
E�
E�
E��+�g�
�C����
��c�=�$�/�/�G���-�-�-�-�-�-��?�g�g�g�.�.����1D�1D�D�D��'��7�7�G�G�G�Z�Z�1�#'����
�
�Js4�B�A	�B�	
A4�A/�/A4�4B�B�B)rKN)rK)rKTNr:)NN)'r%rrrV�typingrrrrrrr	�_pytest.deprecatedr
�
TYPE_CHECKING�typing_extensionsrr�
BaseExceptionrrA�TEST_OUTCOMEr+r2r6�objectr<r>r@rJrr;rPr&rZr]r[rcreryr4rr�<module>r�sl����
�
�
�
�����������������������������������������������.�.�.�.�.�.��
���*�*�*�*�*�*�*�
�������H������}����.!�)�,��5�5�5�5�5��5�5�5�(�����
���������9����
�W�T��#�v�+�.�/�/�/��
�g�e�4�
�.�/�/�/�������X�b�#�g�&����
�C��H�b�T�>�"�c�'�;R�5R�,S����������26�#�PT�#�#�#��#�"*�3�-�#�@H��
�#�
�#�#�#���#�<������ E�49�PT� E� E� E�� E�-1� E�@H��
� E�
� E� E� E��� E�F�����.�.��.�D�.�h�s�m�.�x�.�.�.���.�&7;�!�!��!��!�&.�s�m�!��!�!�!�!�H:�:�:�:�:�f�:�:�:��������#��x�������$MQ�4�4�
�4�&�s�m�4�<D�S�M�4��4�4�4�4�4�4r