
    9[g$)                       d Z ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 dd	lm
Z
 dd
lmZ ddlmZ  G d de      ZeefZ G d de      Z G d de      Z G d de      Z ededef         Z ede
e         Z G d de	eef         Zd&dZ ee      	 	 d'	 	 	 	 	 d(d       Z ee      	 d)dd	 	 	 	 	 d*d       Z ee      d+d,d        Z G d! d"e      Z ee      d)d-d#       Z	 	 d.dd$	 	 	 	 	 	 	 	 	 d/d%Zy)0zZException classes and constants handling test outcomes as well as
functions creating them.    )annotationsN)Any)Callable)cast)NoReturn)Protocol)Type)TypeVar   )PytestDeprecationWarningc                  2     e Zd ZdZdd fdZddZeZ xZS )OutcomeExceptionzmOutcomeException and its subclass instances indicate and contain info
    about test and collection outcomes.c                    |St        |t              sCd}t        |j                  t	        |       j
                  t	        |      j
                              t        |   |       || _        || _	        y )NzY{} expected string as 'msg' parameter, got '{}' instead.
Perhaps you meant to use a mark?)

isinstancestr	TypeErrorformattype__name__super__init__msgpytrace)selfr   r   	error_msg	__class__s       K/var/www/html/bid-api/venv/lib/python3.12/site-packages/_pytest/outcomes.pyr   zOutcomeException.__init__   sd    ?:c3#73  I,,T$Z-@-@$s)BTBTUVV    c                f    | j                   | j                   S d| j                  j                   dS )N<z
 instance>)r   r   r   )r   s    r   __repr__zOutcomeException.__repr__!   s/    8888O4>>**+:66r   )NT)r   
str | Noner   boolreturnNone)r$   r   )r   
__module____qualname____doc__r   r!   __str____classcell__r   s   @r   r   r      s    +	7
 Gr   r   c                  D     e Zd ZdZ	 	 	 ddd	 	 	 	 	 	 	 	 	 d fdZ xZS )SkippedbuiltinsF)_use_item_locationc               D    t         |   ||       || _        || _        y )Nr   r   )r   r   allow_module_levelr/   )r   r   r   r2   r/   r   s        r   r   zSkipped.__init__1   s)     	S'2"4 #5r   )NTF)
r   r"   r   r#   r2   r#   r/   r#   r$   r%   )r   r&   r'   r   r*   r+   s   @r   r-   r-   ,   sY     J #(	5 $)55 5 !	5 !5 
5 5r   r-   c                      e Zd ZdZdZy)Failedz.Raised from an explicit call to pytest.fail().r.   Nr   r&   r'   r(    r   r   r4   r4   @   s
    8Jr   r4   c                  2     e Zd ZdZ	 d	 	 	 	 	 d fdZ xZS )Exitz=Raised for immediate program exits (no tracebacks/summaries).c                @    || _         || _        t        |   |       y N)r   
returncoder   r   )r   r   r;   r   s      r   r   zExit.__init__I   s      $r   )zunknown reasonN)r   r   r;   
int | Noner$   r%   )r   r&   r'   r(   r   r*   r+   s   @r   r8   r8   F   s/    G EI7A	 r   r8   _F.)bound_ETc                  "    e Zd ZU ded<   ded<   y)_WithExceptionr?   	Exceptionr=   __call__N)r   r&   r'   __annotations__r6   r   r   rA   rA   X   s    NLr   rA   c                     d fd}|S )Nc                P    t        t        t        t        f   |       }|_        |S r:   )r   rA   r=   r?   rB   )funcfunc_with_exceptionexception_types     r   decoratez!_with_exception.<locals>.decorate^   s(    ">"c'#:DA(6%""r   )rG   r=   r$   z_WithException[_F, _ET]r6   )rI   rJ   s   ` r   _with_exceptionrK   ]   s    #
 Or   c                    d}t        | |      )a  Exit 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. None means the same as ``0`` (no error), same as :func:`sys.exit`.

    :raises pytest.exit.Exception:
        The exception that is raised.
    T)r8   )reasonr;   __tracebackhide__s      r   exitrO   i   s    " 
vz
""r   Fr2   c                    d}t        | |      )a0  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.

    :raises pytest.skip.Exception:
        The exception that is raised.

    .. 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)r   r2   )r-   )rM   r2   rN   s      r   skiprR   ~   s    B 
f1C
DDr   c                     d}t        | |      )aa  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.

    :raises pytest.fail.Exception:
        The exception that is raised.
    Tr1   )r4   )rM   r   rN   s      r   failrT      s     
VW
--r   c                      e Zd ZdZy)XFailedz/Raised from an explicit call to pytest.xfail().Nr5   r6   r   r   rV   rV      s    9r   rV   c                    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).

    No other code is executed after using ``xfail()`` (it is implemented
    internally by raising an exception).

    :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.

    :raises pytest.xfail.Exception:
        The exception that is raised.
    T)rV   )rM   rN   s     r   xfailrX      s    ( 
&/r   )exc_typec               v   ddl }d}t        | dd       |	t        }d}nd}d}d}|j                         5  |j	                  d       	 t        |        ddd       |r|j                  |d       |r|t        j                  |    }||S t        |dd      }|/ddlm} | ||       ||      k  rt        d| d|d|d
      |S # |$ r\}	|d| d	|	 }t        |d
      }|r9t        |	t              s)dd|  dd|	dddg}
t        dj                  |
            }Y d}	~	d}	~	ww xY w# 1 sw Y   xY w)a  Import 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.
    :param exc_type:
        The exception that should be captured in order to skip modules.
        Must be :py:class:`ImportError` or a subclass.

        If the module can be imported but raises :class:`ImportError`, pytest will
        issue a warning to the user, as often users expect the module not to be
        found (which would raise :class:`ModuleNotFoundError` instead).

        This warning can be suppressed by passing ``exc_type=ImportError`` explicitly.

        See :ref:`import-or-skip-import-error` for details.


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

    :raises pytest.skip.Exception:
        If the module cannot be imported.

    Example::

        docutils = pytest.importorskip("docutils")

    .. versionadded:: 8.2

        The ``exc_type`` parameter.
    r   NT evalFignorezcould not import z: rP   zModule 'z3' was found, but when imported by pytest it raised:z    z;In pytest 9.1 this warning will become an error by default.zYou can fix the underlying problem, or alternatively overwrite this behavior and silence this warning by passing exc_type=ImportError explicitly.zrSee https://docs.pytest.org/en/stable/deprecations.html#pytest-importorskip-default-behavior-regarding-importerror
   )
stacklevel__version__)Versionzmodule z has __version__ z, required is: )warningscompileImportErrorcatch_warningssimplefilter
__import__r-   r   ModuleNotFoundErrorr   joinwarnsysmodulesgetattrpackaging.versionrb   )modname
minversionrM   rY   rc   rN   warn_on_import_errorskippedwarningexclinesmodverattrrb   s                 r   importorskipry      s   Z GR  #$"G"G		 	 	" 	h'	Ew 
#4 g!,
++g
C
c=$/G-?gg.1DD'$5g[PZ~^#'  JI  	E~,WKr#?f>G#Js<O,Pwi'Z[3'NQJ I 3499U3CD!	E 
#	"s0   D/CD,AD'"D/'D,,D//D8)rI   r?   r$   z'Callable[[_F], _WithException[_F, _ET]])r[   N)rM   r   r;   r<   r$   r   )r[   )rM   r   r2   r#   r$   r   )r[   T)rM   r   r   r#   r$   r   )rM   r   r$   r   )NN)
rp   r   rq   r"   rM   r"   rY   ztype[ImportError] | Noner$   r   ) r(   
__future__r   rl   typingr   r   r   r   r   r	   r
   warning_typesr   BaseExceptionr   rB   TEST_OUTCOMEr-   r4   r8   objectr=   r?   rA   rK   rO   rR   rT   rV   rX   ry   r6   r   r   <module>r      s   # 
        3} . !),5 5( 9  T#v+./e4./Xb#g& 
 !### # #( !E  %!E!E !E 	!E !EH . .":f :  2 "m
 *.mmm m
 'm 	mr   