§
    °³Ùg  ã                   óˆ   — d dl Z 	 d dlZd dlmZmZ  ee dd¦  «        Zn# e$ r dZY nw xY wesdd„Z G d„ d¦  «        ZdS dS )	é    N)ÚskipÚraisesÚ_running_pytestFc                 óö   — |€t          | ¦  «        S t          |¦  «        r'	  |¦   «          n# | $ r Y dS w xY wt          d¦  «        ‚t          |t          ¦  «        rt          d¦  «        ‚t          d¦  «        ‚)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 symengine.pytest import raises

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

        >>> with raises(ZeroDivisionError):
        ...     n = 1/0
        >>> with raises(ZeroDivisionError):
        ...     n = 1/2
        Traceback (most recent call last):
        ...
        AssertionError: 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ÚcallableÚAssertionErrorÚ
isinstanceÚstrÚ	TypeError)ÚexpectedExceptionÚcodes     úN/granary/edev/quantum/lib/python3.11/site-packages/symengine/test_utilities.pyr   r      s®   € ðj ˆ<Ý Ð!2Ñ3Ô3Ð3Ý�d‰^Œ^ð 	EðØ�‘”��øØ$ð ð ð Ø��ðøøøå  Ñ1Ô1Ð1Ý˜�cÑ"Ô"ð 		EÝð5ñ6ô 6ð 6õ ØCñEô Eð Es   ¢
- ­6µ6c                   ó    — e Zd Zd„ Zd„ Zd„ ZdS )r   c                 ó   — || _         d S ©N)r   )Úselfr   s     r   Ú__init__zRaisesContext.__init__T   s   € Ø%6ˆDÔ"Ð"Ð"ó    c                 ó   — d S r   © )r   s    r   Ú	__enter__zRaisesContext.__enter__W   s   € Ø�4r   c                 óN   — |€t          d¦  «        ‚t          || j        ¦  «        S )Nr   )r
   Ú
issubclassr   )r   Úexc_typeÚ	exc_valueÚ	tracebacks       r   Ú__exit__zRaisesContext.__exit__Z   s)   € ØÐÝ$ _Ñ5Ô5Ð5Ý˜h¨Ô(>Ñ?Ô?Ð?r   N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   S   sF   € € € € € ð	7ð 	7ð 	7ð	ð 	ð 	ð	@ð 	@ð 	@ð 	@ð 	@r   r   r   )	ÚsysÚpyÚpy.testr   r   ÚgetattrÚ
USE_PYTESTÚImportErrorr   r   r   r   ú<module>r)      sâ   ðØ 
€
€
€
ðØ€I€I€IØ$Ð$Ð$Ð$Ð$Ð$Ð$Ð$Ø�˜Ð/°Ñ7Ô7€J€JøØð ð ð Ø€J€J€Jðøøøð ð S@ðFEð FEð FEð FEðP
@ð 
@ð 
@ð 
@ð 
@ñ 
@ô 
@ð 
@ð 
@ð 
@ðSS@ð S@s   †   *©*