403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/sympy/testing/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/sympy/testing/__pycache__/pytest.cpython-310.pyc
o

�8Va�%�@s�dZddlZddlZddlZddlZddlZddlmZe�dd�Z	zddl
Z
eedd�ZWne
y9dZYnwer\e
jZe
jZe
jZe
jjZe
jjZe
jjZe
jjZddlmZnQGdd	�d	�Zd*d
d�ZGdd
�d
�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Zdd�Zdd�Zdd�Zdd�Zdd�Zejd d!�d"d#��Zd$d%�Z ejd&d'��Z!ejd(d)��Z"dS)+z$py.test hacks to support XFAIL/XPASS�N)�SymPyDeprecationWarning�TRAVIS_BUILD_NUMBER�_running_pytestF)�Failedc@seZdZdd�Zdd�ZdS)�
ExceptionInfocC�
||_dS�N)�value)�selfr	�r�6/usr/lib/python3/dist-packages/sympy/testing/pytest.py�__init__$�
zExceptionInfo.__init__cCsd�|j�S)Nz<ExceptionInfo {!r}>)�formatr	�r
rrr�__repr__'szExceptionInfo.__repr__N)�__name__�
__module__�__qualname__r
rrrrrr#src
Csp|durt|�St|�r+z|�Wtd��|y*}z
t|�WYd}~Sd}~wwt|t�r4td��td��)a�
        Tests that ``code`` raises the exception ``expectedException``.

        ``code`` may be a callable, such as a lambda expression or function
        name.

        If ``code`` is not given or None, ``raises`` will return a context
        manager for use in ``with`` statements; the code to execute then
        comes from the scope of the ``with``.

        ``raises()`` does nothing if the callable raises the expected exception,
        otherwise it raises an AssertionError.

        Examples
        ========

        >>> from sympy.testing.pytest import raises

        >>> raises(ZeroDivisionError, lambda: 1/0)
        <ExceptionInfo ZeroDivisionError(...)>
        >>> raises(ZeroDivisionError, lambda: 1/2)
        Traceback (most recent call last):
        ...
        Failed: DID NOT RAISE

        >>> with raises(ZeroDivisionError):
        ...     n = 1/0
        >>> with raises(ZeroDivisionError):
        ...     n = 1/2
        Traceback (most recent call last):
        ...
        Failed: DID NOT RAISE

        Note that you cannot test multiple statements via
        ``with raises``:

        >>> with raises(ZeroDivisionError):
        ...     n = 1/0    # will execute and raise, aborting the ``with``
        ...     n = 9999/0 # never executed

        This is just what ``with`` is supposed to do: abort the
        contained statement sequence at the first exception and let
        the context manager deal with the exception.

        To test multiple statements, you'll need a separate ``with``
        for each:

        >>> with raises(ZeroDivisionError):
        ...     n = 1/0    # will execute and raise
        >>> with raises(ZeroDivisionError):
        ...     n = 9999/0 # will also execute and raise

        N�
DID NOT RAISEz�'raises(xxx, "code")' has been phased out; change 'raises(xxx, "expression")' to 'raises(xxx, lambda: expression)', 'raises(xxx, "statement")' to 'with raises(xxx): statement'z1raises() expects a callable for the 2nd argument.)�
RaisesContext�callablerr�
isinstance�str�	TypeError)�expectedException�code�errr�raises+s"6���
��rc@s$eZdZdd�Zdd�Zdd�ZdS)rcCrr)r)r
rrrrr
urzRaisesContext.__init__cCsdSrrrrrr�	__enter__xszRaisesContext.__enter__cCs|durtd��t||j�S)Nr)r�
issubclassr)r
�exc_type�	exc_value�	tracebackrrr�__exit__{szRaisesContext.__exit__N)rrrr
rr$rrrrrtsrc@�eZdZdS)�XFailN�rrrrrrrr&��r&c@r%)�XPassNr'rrrrr)�r(r)c@r%)�SkippedNr'rrrrr*�r(r*c@r%)rNr'rrrrr�r(rcs�fdd�}t�|��}|S)Nc
sPz��Wnty"}zt|�}|dkrt�j��td��d}~wwt�j��)N�Timeout)�	Exceptionrr&rr*r))r�message��funcrr�wrapper�s

��
zXFAIL.<locals>.wrapper��	functools�update_wrapper)r/r0rr.r�XFAIL�sr4cCst|��r�r*)rrrr�skip��r6cs�fdd�}|S)z0Similar to ``skip()``, but this is a decorator. cs�fdd�}t�||�}|S)Ncst���rr5r��reasonrr�func_wrapper�r7z+SKIP.<locals>.wrapper.<locals>.func_wrapperr1�r/r:r8rrr0�szSKIP.<locals>.wrapperr)r9r0rr8r�SKIP�sr<cs(d�_�fdd�}t�|��}�|_|S)NTcs
��dSrrrr.rrr:�rzslow.<locals>.func_wrapper)�_slowr2r3�__wrapped__r;rr.r�slow�s
r?cCs|S)zBDummy decorator for marking tests that fail when cache is disabledrr.rrr�nocache_fail�sr@�)�matchc#s��tjdd��}t�d�t�d|��dVWd�n1s!wYt�fdd�|D��s@d�d	d
�|D�f}t|��dS)a�Like raises but tests that warnings are emitted.

        >>> from sympy.testing.pytest import warns
        >>> import warnings

        >>> with warns(UserWarning):
        ...     warnings.warn('deprecated', UserWarning)

        >>> with warns(UserWarning):
        ...     pass
        Traceback (most recent call last):
        ...
        Failed: DID NOT WARN. No warnings of type UserWarning        was emitted. The list of emitted warnings is: [].
        T��record�ignore�alwaysNc3s�|]	}t|j��VqdSr)r �category��.0�w��
warningclsrr�	<genexpr>�s�zwarns.<locals>.<genexpr>z^Failed: DID NOT WARN. No warnings of type %s was emitted. The list of emitted warnings is: %s.cSsg|]}|j�qSr)r-rHrrr�
<listcomp>�szwarns.<locals>.<listcomp>)�warnings�catch_warnings�simplefilter�filterwarnings�anyr)rLrB�warnrec�msgrrKr�warns�s�
���rVcs*ddlm���fdd�}t�|��}|S)a8
    Decorator used to run the test twice: the first time `e^x` is represented
    as ``Pow(E, x)``, the second time as ``exp(x)`` (exponential object is not
    a power).

    This is a temporary trick helping to manage the elimination of the class
    ``exp`` in favor of a replacement by ``Pow(E, ...)``.
    r)�_exp_is_powcsb�d����Wd�n1swY�d����Wd�dS1s*wYdS)NTFrr�rWr/rr�	func_wrap�s
�
"�z _both_exp_pow.<locals>.func_wrap)�sympy.core.parametersrWr2r3)r/rYr0rrXr�
_both_exp_pow�s	r[ccs6�tt��dVWd�dS1swYdS)aSShorthand for ``warns(SymPyDeprecationWarning)``

    This is the recommended way to test that ``SymPyDeprecationWarning`` is
    emitted for deprecated features in SymPy. To test for other warnings use
    ``warns``. To suppress warnings without asserting that they are emitted
    use ``ignore_warnings``.

    >>> from sympy.testing.pytest import warns_deprecated_sympy
    >>> from sympy.utilities.exceptions import SymPyDeprecationWarning
    >>> with warns_deprecated_sympy():
    ...     SymPyDeprecationWarning("Don't use", feature="old thing",
    ...         deprecated_since_version="1.0", issue=123).warn()

    >>> with warns_deprecated_sympy():
    ...     pass
    Traceback (most recent call last):
    ...
    Failed: DID NOT WARN. No warnings of type     SymPyDeprecationWarning was emitted. The list of emitted warnings is: [].
    N)rVrrrrr�warns_deprecated_sympy�s�
"�r\ccsr�tjdd��}t�d|�dVWd�n1swY|D]}t|j|�s6t�|j|j|j|j�q"dS)arContext manager to suppress warnings during tests.

    This function is useful for suppressing warnings during tests. The warns
    function should be used to assert that a warning is raised. The
    ignore_warnings function is useful in situation when the warning is not
    guaranteed to be raised (e.g. on importing a module) or if the warning
    comes from third-party code.

    When the warning is coming (reliably) from SymPy the warns function should
    be preferred to ignore_warnings.

    >>> from sympy.testing.pytest import ignore_warnings
    >>> import warnings

    Here's a warning:

    >>> with warnings.catch_warnings():  # reset warnings in doctest
    ...     warnings.simplefilter('error')
    ...     warnings.warn('deprecated', UserWarning)
    Traceback (most recent call last):
      ...
    UserWarning: deprecated

    Let's suppress it with ignore_warnings:

    >>> with warnings.catch_warnings():  # reset warnings in doctest
    ...     warnings.simplefilter('error')
    ...     with ignore_warnings(UserWarning):
    ...         warnings.warn('deprecated', UserWarning)

    (No warning emitted)
    TrCrFN)	rOrPrQr rG�
warn_explicitr-�filename�lineno)rLrTrJrrr�ignore_warningss�#���r`r)#�__doc__�sysr2�os�
contextlibrO�sympy.utilities.exceptionsr�getenv�	ON_TRAVIS�pytest�getattr�
USE_PYTEST�ImportErrorrrVr6�mark�xfailr4r<r?r@�_pytest.outcomesrrrr,r&r)r*�contextmanagerr[r\r`rrrr�<module>sT�
I
!


Youez - 2016 - github.com/yon3zu
LinuXploit