ó
¡¼™\c           @   s)  d  d l  Z  d  d l m Z m Z m Z m Z m Z d  d l m Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d S(   iÿÿÿÿN(   t   raisest   warnst   ignore_warningst   warns_deprecated_sympyt   Failed(   t   SymPyDeprecationWarningc          C   s   d „  }  t  t |  ƒ d  S(   Nc           S   s   t  ƒ  ‚ d  S(   N(   t
   ValueError(    (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   f   s    (   R    R   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt*   test_expected_exception_is_silent_callable   s    	c          C   sR   y  t  t d „  ƒ t s t ‚ Wn+ t k
 rM }  d t |  ƒ k sN t ‚ n Xd  S(   Nc           S   s   d S(   Ni   i   (    (    (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   <lambda>   t    s   DID NOT RAISE(   R    t	   Exceptiont   Falset   AssertionErrorR   t   str(   t   e(    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt7   test_lack_of_exception_triggers_AssertionError_callable   s
    c          C   sX   d „  }  y t  t |  ƒ t s% t ‚ Wn+ t k
 rS } t | ƒ d k sT t ‚ n Xd  S(   Nc           S   s   t  d ƒ ‚ d  S(   Ns   some error message(   R   (    (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyR      s    s   some error message(   R    t	   TypeErrorR   R   R   R   (   R   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt4   test_unexpected_exception_is_passed_through_callable   s    	c           C   s    t  t ƒ  t ƒ  ‚ Wd  QXd  S(   N(   R    R   (    (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt&   test_expected_exception_is_silent_with&   s    c          C   sY   y' t  t ƒ 	 d Wd  QXt s& t ‚ Wn+ t k
 rT }  d t |  ƒ k sU t ‚ n Xd  S(   Ni   s   DID NOT RAISEi   (   R    R   R   R   R   R   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt3   test_lack_of_exception_triggers_AssertionError_with+   s    
c          C   sa   y/ t  t ƒ  t d ƒ ‚ Wd  QXt s. t ‚ Wn+ t k
 r\ }  t |  ƒ d k s] t ‚ n Xd  S(   Ns   some error message(   R    R   R   R   R   R   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt0   test_unexpected_exception_is_passed_through_with4   s    c           C   s   t  t d „  ƒ d  S(   Nc           S   s   t  d d ƒ S(   Nt
   irrelevanti*   (   R    (    (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyR	   A   R
   (   R    R   (    (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt1   test_second_argument_should_be_callable_or_string@   s    c       
   C   sW   t  j d t ƒ ? }  t t ƒ  t  j d ƒ Wd  QXt |  ƒ d k sM t ‚ Wd  QXd  S(   Nt   records   this is the warning messagei    (   t   warningst   catch_warningst   TrueR   t   UserWarningt   warnt   lenR   (   t   w(    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   test_warns_catches_warningD   s    c        	   C   s*   t  t ƒ  t t ƒ  Wd  QXWd  QXd  S(   N(   R    R   R   R   (    (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt!   test_warns_raises_without_warningK   s    c          C   sj   t  j d t ƒ R }  t t ƒ % t  j d t ƒ t  j d t ƒ Wd  QXt |  ƒ d k s` t ‚ Wd  QXd  S(   NR   s   this is the warning messages   this is the other messagei    (	   R   R   R   R   R   R   t   RuntimeWarningR   R   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   test_warns_hides_other_warningsQ   s
    c       
   C   so   t  j d t ƒ W }  t } t t ƒ  t  j d ƒ t } Wd  QX| sM t ‚ t |  ƒ d k se t ‚ Wd  QXd  S(   NR   s   this is the warning messagei    (	   R   R   R   R   R   R   R   R   R   (   R   t   finished(    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt"   test_warns_continues_after_warningZ   s    c          C   s²   t  j d t ƒ š }  t } t t ƒ [ t  j d t ƒ t  j d t ƒ t  j d t ƒ t  j d t ƒ t  j d t ƒ t } Wd  QX| s t ‚ t	 |  ƒ d k s¨ t ‚ Wd  QXd  S(   NR   s   this is the warning messages   this is the other messagei    (
   R   R   R   R   R   R   R   R"   R   R   (   R   R$   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   test_warns_many_warningsd   s    c          C   s`   t  j d t ƒ H }  t t d d ƒ t  j d t ƒ Wd  QXt |  ƒ d k sV t ‚ Wd  QXd  S(   NR   t   matchs   this is the warning messagei    (   R   R   R   R   R   R   R   R   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   test_warns_match_matchings   s    c          C   ss   t  j d t ƒ [ }  t t ƒ . t t d d ƒ t  j d t ƒ Wd  QXWd  QXt |  ƒ d k si t	 ‚ Wd  QXd  S(   NR   R'   s   this is the warning messages(   this is not the expected warning messagei    (
   R   R   R   R    R   R   R   R   R   R   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   test_warns_match_non_matchingz   s
    c        	   C   s)   t  d d d d d d d d ƒ j ƒ  d  S(	   Nt   featuret   foot
   useinsteadt   bart   issuei   t   deprecated_since_versions   0.0.0(   R   R   (    (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   _warn_sympy_deprecation   s
    c       	   C   sN   t  j d t ƒ 6 }  t ƒ   t ƒ  Wd  QXt |  ƒ d k sD t ‚ Wd  QXd  S(   NR   i    (   R   R   R   R   R0   R   R   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt+   test_warns_deprecated_sympy_catches_warningˆ   s    
c        	   C   s'   t  t ƒ  t ƒ   Wd  QXWd  QXd  S(   N(   R    R   R   (    (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt2   test_warns_deprecated_sympy_raises_without_warning   s    
c          C   s^   t  j d t ƒ F }  t ƒ   t ƒ  t  j d t ƒ Wd  QXt |  ƒ d k sT t ‚ Wd  QXd  S(   NR   s   this is the other messagei    (	   R   R   R   R   R0   R   R"   R   R   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt0   test_warns_deprecated_sympy_hides_other_warnings•   s
    
c       	   C   sf   t  j d t ƒ N }  t } t ƒ   t ƒ  t } Wd  QX| sD t ‚ t |  ƒ d k s\ t ‚ Wd  QXd  S(   NR   i    (   R   R   R   R   R   R0   R   R   (   R   R$   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt3   test_warns_deprecated_sympy_continues_after_warningž   s    
c          C   s   t  j d t ƒ … }  t } t ƒ  I t ƒ  t  j d t ƒ t ƒ  t  j d t ƒ t  j d t ƒ t } Wd  QX| s{ t ‚ t	 |  ƒ d k s“ t ‚ Wd  QXd  S(   NR   s   this is the other messagei    (
   R   R   R   R   R   R0   R   R"   R   R   (   R   R$   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt)   test_warns_deprecated_sympy_many_warnings¨   s    
c       
   C   sW   t  j d t ƒ ? }  t t ƒ  t  j d ƒ Wd  QXt |  ƒ d k sM t ‚ Wd  QXd  S(   NR   s   this is the warning messagei    (   R   R   R   R   R   R   R   R   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   test_ignore_ignores_warning·   s    c       	   C   sJ   t  j d t ƒ 2 }  t t ƒ  Wd  QXt |  ƒ d k s@ t ‚ Wd  QXd  S(   NR   i    (   R   R   R   R   R   R   R   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt*   test_ignore_does_not_raise_without_warning¾   s    c          C   s¥   t  j d t ƒ  }  t t ƒ % t  j d t ƒ t  j d t ƒ Wd  QXt |  ƒ d k s` t ‚ t	 |  d j
 t ƒ s| t ‚ t |  d j
 ƒ d k s› t ‚ Wd  QXd  S(   NR   s   this is the warning messages   this is the other messagei   i    (   R   R   R   R   R   R   R"   R   R   t
   isinstancet   messageR   (   R   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt!   test_ignore_allows_other_warningsÅ   s    c       
   C   so   t  j d t ƒ W }  t } t t ƒ  t  j d ƒ t } Wd  QX| sM t ‚ t |  ƒ d k se t ‚ Wd  QXd  S(   NR   s   this is the warning messagei    (	   R   R   R   R   R   R   R   R   R   (   R   R$   (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt#   test_ignore_continues_after_warningÏ   s    c          C   sÞ   t  j d t ƒ Æ }  t t ƒ U t  j d t ƒ t  j d t ƒ t  j d t ƒ t  j d t ƒ t  j d t ƒ Wd  QXt |  ƒ d k s t ‚ xA |  D]9 } t	 | j
 t ƒ sµ t ‚ t | j
 ƒ d k s— t ‚ q— WWd  QXd  S(   NR   s   this is the warning messages   this is the other messagei   (   R   R   R   R   R   R   R"   R   R   R8   R9   R   (   R   t   wi(    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   test_ignore_many_warningsÙ   s    ("   R   t   sympy.utilities.pytestR    R   R   R   R   t   sympy.utilities.exceptionsR   R   R   R   R   R   R   R   R    R!   R#   R%   R&   R(   R)   R0   R1   R2   R3   R4   R5   R6   R7   R:   R;   R=   (    (    (    s@   lib/python2.7/site-packages/sympy/utilities/tests/test_pytest.pyt   <module>   s6   (													
									
				
	
