ó
|‰ãW£  c           @   s’  d  d l  Z d  d l j j Z d  d l Z d  d l Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d	 „  Z e j j j d
 ƒ d „  ƒ Z e j j j d
 ƒ d „  ƒ Z d „  Z d „  Z d d! d „  ƒ  YZ d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d" d „  ƒ  YZ d „  Z e j j j d
 ƒ d „  ƒ Z  d „  Z! d „  Z" d „  Z# e j j d ƒ d „  ƒ Z$ d  „  Z% d S(#   iÿÿÿÿNc           C   s   t  j j j ƒ  d S(   Ni   (   t   pyt   stdt   syst   exc_info(    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   exvalue   s    c           C   s   d S(   Ni   (    (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   f   s    c    	      C   sÁ  yØ t  ƒ  }  d } |  | k } | sÉ t j d | f d |  | f ƒ i d t j ƒ  k sf t j t  ƒ ru t j t  ƒ n d d 6t j |  ƒ d 6t j | ƒ d 6} d i | d
 6} t t j | ƒ ƒ ‚ n  d  }  } } Wnâ t k
 r¼t
 ƒ  } t | ƒ } | j }  d } |  | ƒ } | s«d d i d t j ƒ  k sIt j | ƒ rXt j | ƒ n d d 6t j |  ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  }  } } n Xd  S(   Ni   s   ==s)   %(py2)s
{%(py2)s = %(py0)s()
} == %(py5)sR   t   py0t   py2t   py5t    s   assert %(py7)st   py7s   assert 2 == 3
sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}t   st   py4t   py6(   s   ==(   s)   %(py2)s
{%(py2)s = %(py0)s()
} == %(py5)ss   assert %(py7)s(   R   t
   @pytest_art   _call_reprcomparet   @py_builtinst   localst   _should_repr_global_namet	   _safereprt   AssertionErrort   _format_explanationt   NoneR   t   strt
   startswith(	   t   @py_assert1t   @py_assert4t   @py_assert3t   @py_format6t   @py_format8t   eR   t   @py_assert5t   @py_format7(    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert	   s&    	    |   		    u  c    
      C   sÏ  t  j j t d ƒ }  |  j ƒ  } t  j } | j } | j } d } | | | ƒ } | t k	 } | r±t	 j
 d f | f d f | t f ƒ i t	 j | ƒ d 6d t j ƒ  k p¹ t	 j | ƒ rË t	 j | ƒ n d d 6d t j ƒ  k pð t	 j t  ƒ rt	 j t  ƒ n d d	 6d
 t j ƒ  k p't	 j t ƒ r9t	 j t ƒ n d
 d 6t	 j | ƒ d 6t	 j | ƒ d 6t	 j | ƒ d 6t	 j | ƒ d 6} d d i | d 6}	 t t	 j |	 ƒ ƒ ‚ n  t } } } } } } d  S(   NsF   
        try:
            1/0
        finally:
            i = 42
    s   division.+by zeros   is nots   %(py11)s
{%(py11)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.std
}.re
}.search
}(%(py8)s, %(py9)s)
} is not %(py13)st   py8R   t   py9R    R   R   t   py13R   t   py11R   R   R	   s   assert %(py15)st   py15(   R    t   testt   raisest   ZeroDivisionErrort   exconlyR   t   ret   searchR   R   R   R   R   R   R   R   R   (
   t   excinfoR   R   R   R   t   @py_assert7t   @py_assert10t   @py_assert12t   @py_format14t   @py_format16(    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_within_finally   s    		 	 	     ÿ !   c    	      C   sÁ  yØ t  ƒ  }  d } |  | k } | sÉ t j d | f d |  | f ƒ i d t j ƒ  k sf t j t  ƒ ru t j t  ƒ n d d 6t j |  ƒ d 6t j | ƒ d 6} d i | d
 6} t t j | ƒ ƒ ‚ n  d  }  } } Wnâ t k
 r¼t
 ƒ  } t | ƒ } | j }  d } |  | ƒ } | s«d d i d t j ƒ  k sIt j | ƒ rXt j | ƒ n d d 6t j |  ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  }  } } n Xd  S(   Ni   s   ==s)   %(py2)s
{%(py2)s = %(py0)s()
} == %(py5)sR   R   R   R   R	   s   assert %(py7)sR
   s   assert 2 == 3
sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}R   R   R   (   s   ==(   s)   %(py2)s
{%(py2)s = %(py0)s()
} == %(py5)ss   assert %(py7)s(   R   R   R   R   R   R   R   R   R   R   R   R   R   (	   R   R   R   R   R   R   R   R   R    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_multiline_1#   s&    	    |   		    u  c    	      C   sÁ  yØ t  ƒ  }  d } |  | k } | sÉ t j d | f d |  | f ƒ i d t j ƒ  k sf t j t  ƒ ru t j t  ƒ n d d 6t j |  ƒ d 6t j | ƒ d	 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  }  } } Wnâ t k
 r¼t
 ƒ  } t | ƒ } | j }  d } |  | ƒ } | s«d
 d i d t j ƒ  k sIt j | ƒ rXt j | ƒ n d d 6t j |  ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  }  } } n Xd  S(   Ni   i   iÿÿÿÿs   ==s)   %(py2)s
{%(py2)s = %(py0)s()
} == %(py5)sR   R   R   R   R	   s   assert %(py7)sR
   s   assert 2 ==sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}R   R   R   (   i   i   i   (   s   ==(   s)   %(py2)s
{%(py2)s = %(py0)s()
} == %(py5)ss   assert %(py7)s(   R   R   R   R   R   R   R   R   R   R   R   R   R   (	   R   R   R   R   R   R   R   R   R    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_multiline_2,   s&    	    |   		    u  c    	      C   s  y¤ d }  d d g } |  | k } | s• t  j d | f d |  | f ƒ i t  j |  ƒ d 6t  j | ƒ d 6} d i | d
 6} t t  j | ƒ ƒ ‚ n  d  }  } } Wnâ t k
 rˆt ƒ  } t | ƒ } | j } d } | | ƒ } | swd d i d t	 j
 ƒ  k st  j | ƒ r$t  j | ƒ n d d 6t  j | ƒ d 6t  j | ƒ d 6t  j | ƒ d
 6} t t  j | ƒ ƒ ‚ n  d  } } } n Xd  S(   Nt   hii   i   t   ins   %(py1)s in %(py4)st   py1R   R	   s   assert %(py6)sR   s   assert 'hi' insL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}R   R   R   (   R7   (   s   %(py1)s in %(py4)ss   assert %(py6)s(   R   R   R   R   R   R   R   R   R   R   R   R   (	   t   @py_assert0R   t   @py_assert2t   @py_format5R    R   R   R   R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_in5   s&        E   		    u  c    	      C   s‡  yž d }  d } |  | k } | s t  j d | f d |  | f ƒ i t  j |  ƒ d 6t  j | ƒ d 6} d i | d	 6} t t  j | ƒ ƒ ‚ n  d  }  } } Wnâ t k
 r‚t ƒ  } t | ƒ } | j } d
 } | | ƒ } | sqd d i d t	 j
 ƒ  k st  j | ƒ rt  j | ƒ n d d 6t  j | ƒ d 6t  j | ƒ d 6t  j | ƒ d	 6} t t  j | ƒ ƒ ‚ n  d  } } } n Xd  S(   Ni   i   t   iss   %(py1)s is %(py4)sR8   R   R	   s   assert %(py6)sR   s   assert 1 is 2sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}R   R   R   (   R=   (   s   %(py1)s is %(py4)ss   assert %(py6)s(   R   R   R   R   R   R   R   R   R   R   R   R   (	   R9   R   R:   R;   R    R   R   R   R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_is=   s&        E   		    u  s   sys.version_info < (2,6)c          C   sà  d t  f d „  ƒ  Y}  |  ƒ  } yØ | j } d } | | k } | sè t j d | f d | | f ƒ i d t j ƒ  k s… t j | ƒ r” t j | ƒ n d d 6t j | ƒ d 6t j | ƒ d	 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } } Wnâ t k
 rÛt ƒ  } t | ƒ } | j } d } | | ƒ }	 |	 sÊd
 d i d t j ƒ  k sht j | ƒ rwt j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j |	 ƒ d 6}
 t t j	 |
 ƒ ƒ ‚ n  d  } } }	 n Xd  S(   Nt   Fooc           B   s   e  Z d  Z RS(   i   (   t   __name__t
   __module__t   b(    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyR?   H   s   i   s   ==s)   %(py2)s
{%(py2)s = %(py0)s.b
} == %(py5)st   iR   R   R   R	   s   assert %(py7)sR
   s   assert 1 == 2sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}R   R   R   (   s   ==(   s)   %(py2)s
{%(py2)s = %(py0)s.b
} == %(py5)ss   assert %(py7)s(   t   objectRB   R   R   R   R   R   R   R   R   R   R   R   R   (   R?   RC   R   R   R   R   R   R   R   R   R    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_attribF   s*    		    |   		    u  c    
      C   sô  d t  f d „  ƒ  Y}  yõ |  ƒ  } | j } d } | | k } | sø t j d | f d | | f ƒ i d t j ƒ  k s… t j |  ƒ r” t j |  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d	 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } } } } Wnâ t k
 rït ƒ  } t | ƒ } | j } d } | | ƒ } | sÞd
 d i d t j ƒ  k s|t j | ƒ r‹t j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6}	 t t j	 |	 ƒ ƒ ‚ n  d  } } } n Xd  S(   NR?   c           B   s   e  Z d  Z RS(   i   (   R@   RA   RB   (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyR?   T   s   i   s   ==s@   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s()
}.b
} == %(py7)sR   R   R   R
   R	   s   assert %(py9)sR#   s   assert 1 == 2sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}R   R   (   s   ==(   s@   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s()
}.b
} == %(py7)ss   assert %(py9)s(   RD   RB   R   R   R   R   R   R   R   R   R   R   R   R   (
   R?   R   R   t   @py_assert6R   R   t   @py_format10R   R   R    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_attrib_instR   s*    	 	    Œ   		    u  c          C   sÄ  t  t d ƒ ƒ }  yt |  ƒ } d } | | k } | st j d | f d | | f ƒ i d t j ƒ  k s{ t j t ƒ rŠ t j t ƒ n d d 6d t j ƒ  k s² t j |  ƒ rÁ t j |  ƒ n d d 6t j | ƒ d	 6t j | ƒ d
 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  } } } Wn™t	 k
 r¿t ƒ  } t | ƒ } | j } d }	 | |	 ƒ } | s÷d d i d t j ƒ  k s•t j | ƒ r¤t j | ƒ n d d 6t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d
 6} t	 t j
 | ƒ ƒ ‚ n  d  } }	 } d }
 |
 | k } | s²t j d | f d |
 | f ƒ i t j |
 ƒ d 6d t j ƒ  k sot j | ƒ r~t j | ƒ n d d	 6} d i | d 6} t	 t j
 | ƒ ƒ ‚ n  d  }
 } n Xd  S(   Ni*   id   s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)st   lenR   t   lR8   t   py3R   R	   s   assert %(py8)sR"   s   assert 42 == 100sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}R   R   R   s   where 42 = len([R7   s   %(py1)s in %(py3)ss   assert %(py5)sR   (   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   R7   (   s   %(py1)s in %(py3)ss   assert %(py5)s(   t   listt   rangeRI   R   R   R   R   R   R   R   R   R   R   R   R   (   RJ   R:   R   R   R    t   @py_format9R   R   R   R   R9   t   @py_format4R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_len]   s6        ³   		    u     l   c    
      C   s§  d d „ }  y¦ d } |  d | ƒ } | s§ d d i d t  j ƒ  k sU t j |  ƒ rd t j |  ƒ n d d 6t j | ƒ d	 6t j | ƒ d
 6} t t j | ƒ ƒ ‚ n  d  } } Wnî t k
 r¢t ƒ  } d } | j	 } | | k } | s‘t j
 d | f d | | f ƒ i t j | ƒ d 6d t  j ƒ  k s>t j | ƒ rMt j | ƒ n d d 6t j | ƒ d 6} d i | d 6}	 t t j |	 ƒ ƒ ‚ n  d  } } } n Xd  S(   Ni   c         S   s   t  S(   N(   t   False(   t   x(    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyR   i   s    i   RR   R	   s.   assert %(py4)s
{%(py4)s = %(py0)s(x=%(py2)s)
}R   R   R   R   s   x=5R7   s+   %(py1)s in %(py5)s
{%(py5)s = %(py3)s.msg
}R8   R   RK   R   s   assert %(py7)sR
   (   R7   (   s+   %(py1)s in %(py5)s
{%(py5)s = %(py3)s.msg
}s   assert %(py7)s(   R   R   R   R   R   R   R   R   R   t   msgR   (
   R   R   R   R;   R   R9   R   R:   R   R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_keyword_argh   s$       e  	 	   |   t	   WeirdReprc           B   s   e  Z d  „  Z RS(   c         C   s   d S(   Ns   <WeirdRepr
second line>(    (   t   self(    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   __repr__s   s    (   R@   RA   RW   (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRU   r   s   c          C   s  t  ƒ  }  y» d } |  | k } | s¹ t j d | f d |  | f ƒ i d t j ƒ  k sf t j |  ƒ ru t j |  ƒ n d d 6t j | ƒ d 6} d i | d	 6} t t j | ƒ ƒ ‚ n  d  } } Wn´t k
 rzt
 ƒ  } | j } | j } d
 } | | ƒ } d }	 | |	 k }
 |
 sît j d |
 f d | |	 f ƒ i t j | ƒ d 6d t j ƒ  k skt j | ƒ rzt j | ƒ n d d 6t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6t j | ƒ d 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } } }
 }	 | j } | j } d } | | ƒ } d }	 | |	 k }
 |
 st j d  |
 f d! | |	 f ƒ i t j | ƒ d 6d t j ƒ  k s–t j | ƒ r¥t j | ƒ n d d 6t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6t j | ƒ d 6} d" i | d 6} t t j | ƒ ƒ ‚ n  d  } } } } }
 }	 d } | sqd# i t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } n Xd  S($   Ni   s   ==s   %(py0)s == %(py3)st   vR   RK   R	   s   assert %(py5)sR   RU   iÿÿÿÿs   !=sd   %(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.msg
}.find
}(%(py6)s)
} != %(py11)sR"   R   R   R%   R   R   s   assert %(py13)sR$   s   second linei    s   assert %(py1)sR8   (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   s   !=(   sd   %(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.msg
}.find
}(%(py6)s)
} != %(py11)ss   assert %(py13)s(   s   !=(   sd   %(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.msg
}.find
}(%(py6)s)
} != %(py11)ss   assert %(py13)ss   assert %(py1)s(   RU   R   R   R   R   R   R   R   R   R   R   RS   t   find(   RX   R:   R   RO   R   R   R   R   R.   R/   t   @py_assert9t   @py_format12R1   R9   t   @py_format2(    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   bug_test_assert_reprv   sL    	   l   		 	      ¬   	 	      ¬       c          C   s¤  yX d }  |  sQ t  j d g ƒ d i t  j |  ƒ d 6} t t  j | ƒ ƒ ‚ n  d  }  WnEt k
 rŸt ƒ  } | j } | j } d } | | ƒ } d } | | k } | s‚t  j	 d | f d | | f ƒ i t  j | ƒ d 6d	 t
 j ƒ  k sÿ t  j | ƒ rt  j | ƒ n d	 d
 6t  j | ƒ d 6t  j | ƒ d 6t  j | ƒ d 6t  j | ƒ d 6}	 d i |	 d 6}
 t t  j |
 ƒ ƒ ‚ n  d  } } } } } } n Xd  S(   Ni    RL   s   
>assert %(py1)sR8   iÿÿÿÿs   !=sd   %(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.msg
}.find
}(%(py6)s)
} != %(py11)sR"   R   R   R   R%   R   R   R	   s   assert %(py13)sR$   (   s   !=(   sd   %(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.msg
}.find
}(%(py6)s)
} != %(py11)ss   assert %(py13)s(   R   t   _format_assertmsgR   R   R   R   R   RS   RY   R   R   R   R   (   R9   R\   R   R   R   R   R.   R/   RZ   R[   R1   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_non_string€   s&      *  
		 	      ¬   c          C   s  yÓ d d d g }  d d d g } |  | k } | sÈ t  j d | f d |  | f ƒ i d t j ƒ  k su t  j |  ƒ r„ t  j |  ƒ n d d 6t  j | ƒ d 6} d i | d 6} t t  j | ƒ ƒ ‚ n  d  } } WnEt k
 rt	 ƒ  } | j
 } | j } d } | | ƒ } d }	 | |	 k }
 |
 sýt  j d |
 f d | |	 f ƒ i t  j | ƒ d 6d t j ƒ  k szt  j | ƒ r‰t  j | ƒ n d d 6t  j | ƒ d 6t  j |	 ƒ d 6t  j | ƒ d 6t  j | ƒ d 6} d i | d 6} t t  j | ƒ ƒ ‚ n  d  } } } } }
 }	 n Xd  S(   Ni   i   i   s   !=s   %(py0)s != %(py3)sRR   R   RK   R	   s   assert %(py5)sR   s   assert [1, 2, 3] !=iÿÿÿÿsd   %(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.msg
}.find
}(%(py6)s)
} != %(py11)sR"   R   R   R%   R   R   s   assert %(py13)sR$   (   s   !=(   s   %(py0)s != %(py3)ss   assert %(py5)s(   s   !=(   sd   %(py8)s
{%(py8)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.msg
}.find
}(%(py6)s)
} != %(py11)ss   assert %(py13)s(   R   R   R   R   R   R   R   R   R   R   RS   RY   (   RR   R:   R   RO   R   R   R   R   R.   R/   RZ   R[   R1   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_implicit_multiline‡   s,       l   		 	      ¬   c          C   sQ   d d d „  ƒ  Y}  t  |  ƒ  ƒ } | j j d ƒ d k rM t j j d ƒ n  d  S(   Nt
   BrokenReprc           B   s   e  Z d  „  Z RS(   c         S   s   d d d  S(   Ni    (    (   RV   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRW   “   s    (   R@   RA   RW   (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRa   ’   s   s   broken __repr__iÿÿÿÿs$   broken __repr__ not handle correctly(    (   R   RS   RY   R    R'   t   fail(   Ra   R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_with_brokenrepr_arg‘   s    c    	      C   s¶  yÁ d }  d } |  | k } | s¶ t  j d | f d |  | f ƒ i d t j ƒ  k sc t  j |  ƒ rr t  j |  ƒ n d d 6t  j | ƒ d 6} d i | d
 6} t t  j | ƒ ƒ ‚ n  d  } } Wnî t k
 r±t	 ƒ  } d } | j
 } | | k } | s t  j d | f d | | f ƒ i t  j | ƒ d 6d t j ƒ  k sMt  j | ƒ r\t  j | ƒ n d d 6t  j | ƒ d
 6} d i | d 6} t t  j | ƒ ƒ ‚ n  d  } } } n Xd  S(   Ni   i   s   ==s   %(py0)s == %(py3)st   aR   RK   R	   s   assert %(py5)sR   s   assert 1 == 2R7   s+   %(py1)s in %(py5)s
{%(py5)s = %(py3)s.msg
}R8   R   s   assert %(py7)sR
   (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   R7   (   s+   %(py1)s in %(py5)s
{%(py5)s = %(py3)s.msg
}s   assert %(py7)s(   R   R   R   R   R   R   R   R   R   R   RS   (	   Rd   R:   R   RO   R   R   R9   R   R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt!   test_multiple_statements_per_line˜   s&        l   	 	   |   c    	      C   s»  yÆ d }  d } |  | } d } | | k } | s¯ t  j d | f d | | f ƒ i t  j |  ƒ d 6t  j | ƒ d 6t  j | ƒ d 6} d i | d 6} t t  j | ƒ ƒ ‚ n  d  }  } } } } Wnî t k
 r¶t ƒ  } d }  | j } |  | k } | s¥t  j d | f d |  | f ƒ i t  j |  ƒ d 6d t j	 ƒ  k sRt  j
 | ƒ rat  j | ƒ n d d 6t  j | ƒ d 6} d i | d 6} t t  j | ƒ ƒ ‚ n  d  }  } } n Xd  S(   Ni   i   i   s   ==s   (%(py1)s ** %(py3)s) == %(py7)sR8   RK   R
   R	   s   assert %(py9)sR#   s   assert (2 ** 3) == 7R7   s+   %(py1)s in %(py5)s
{%(py5)s = %(py3)s.msg
}R   R   s   assert %(py7)s(   s   ==(   s   (%(py1)s ** %(py3)s) == %(py7)ss   assert %(py9)s(   R7   (   s+   %(py1)s in %(py5)s
{%(py5)s = %(py3)s.msg
}s   assert %(py7)s(   R   R   R   R   R   R   R   RS   R   R   R   (	   R9   R:   R   RF   R   R   RG   R   R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt
   test_powerŸ   s*      
    U   	 	   |   t   TestViewc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   t  j j d ƒ j |  _ d  S(   Ns   py._code._assertionold(   R    R'   t   importorskipt   View(   t   cls(    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   setup_class©   s    c            s  d |  j  f d „  ƒ  Y‰  d ˆ  f d „  ƒ  Y} d ˆ  f ‡  f d †  ƒ  Y‰ d ˆ f ‡ f d †  ƒ  Y} d	 } ˆ  | ƒ } | j } | ƒ  } d
 } | | k } | sxt j d | f d | | f ƒ i t j | ƒ d 6d t j ƒ  k sõ t j ˆ  ƒ rt j ˆ  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6}	 d i |	 d 6}
 t t j	 |
 ƒ ƒ ‚ n  d  } } } } } } d d d g d g } ˆ  | ƒ } | j } | ƒ  } d } | | k } | s²t j d | f d  | | f ƒ i t j | ƒ d 6d t j ƒ  k s/t j ˆ  ƒ r>t j ˆ  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6}	 d! i |	 d 6}
 t t j	 |
 ƒ ƒ ‚ n  d  } } } } } } i d d 6} ˆ  | ƒ } | j } | ƒ  } d } | | k } | sät j d" | f d# | | f ƒ i t j | ƒ d 6d t j ƒ  k sat j ˆ  ƒ rpt j ˆ  ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6}	 d$ i |	 d 6}
 t t j	 |
 ƒ ƒ ‚ n  d  } } } } } } d  S(%   Nt	   Picklablec           B   s   e  Z RS(    (   R@   RA   (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRl   ¯   s   t   Simplec           B   s   e  Z e Z d  „  Z RS(   c         S   s   t  |  j ƒ S(   N(   t   reprt   __obj__(   RV   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   pickle´   s    (   R@   RA   RD   t   __view__Rp   (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRm   ²   s   t   Seqc              s&   e  Z e e e f Z ‡  f d  †  Z RS(   c            s/   d j  g  |  j D] } ˆ  | ƒ j ƒ  ^ q ƒ S(   Nt   ;(   t   joinRo   Rp   (   RV   t   item(   Rl   (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRp   ¹   s    (   R@   RA   RL   t   tuplet   dictRq   Rp   (    (   Rl   (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRr   ·   s   t   Dictc              s   e  Z e Z ‡  f d  †  Z RS(   c            s'   ˆ  j  |  ƒ d ˆ  |  j ƒ  ƒ j  ƒ  S(   Nt   !(   Rp   t   values(   RV   (   Rr   (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRp   ¿   s    (   R@   RA   Rw   Rq   Rp   (    (   Rr   (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRx   ½   s   i{   t   123s   ==sd   %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}.pickle
}()
} == %(py11)sR"   R   R   R%   R   R   R	   s   assert %(py13)sR$   i   i   i   i   s   1;2;3;4s   1!2(   s   ==(   sd   %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}.pickle
}()
} == %(py11)ss   assert %(py13)s(   s   ==(   sd   %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}.pickle
}()
} == %(py11)ss   assert %(py13)s(   s   ==(   sd   %(py8)s
{%(py8)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py0)s(%(py2)s)
}.pickle
}()
} == %(py11)ss   assert %(py13)s(   Ri   Rp   R   R   R   R   R   R   R   R   R   (   RV   Rm   Rx   R   R   R   R.   R/   RZ   R[   R1   (    (   Rl   Rr   sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_class_dispatch¬   sJ      	 	    ¬     	 	    ¬     	 	    ¬   c         C   ss  d d d „  ƒ  Y} | d d d ƒ | d d d ƒ | d	 d
 d d ƒ | d d d ƒ g } d |  j  f d „  ƒ  Y} d | f d „  ƒ  Y} g  | D] } | | ƒ j ƒ  ^ qŽ } d d d d g } | | k } | set j d  | f d! | | f ƒ i d t j ƒ  k st j | ƒ r!t j | ƒ n d d 6t j | ƒ d 6}	 d" i |	 d 6}
 t t j	 |
 ƒ ƒ ‚ n  d  } } d  S(#   Nt	   Operationc           B   s   e  Z d  Z d „  Z RS(   s+   Existing class that I don't want to change.c         W   s   | |  _  | |  _ d  S(   N(   t   opnamet   args(   RV   R~   R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   __init__Ê   s    	(   R@   RA   t   __doc__R€   (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyR}   È   s   t   +i   i   t   getitemR	   Rt   t   setattrRR   t   yi   t   -i   i   t   PyOpc           B   s   e  Z d  „  Z d „  Z RS(   c         S   s   |  j  S(   N(   R~   (   RV   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   __viewkey__Ô   s    c         S   s&   d |  j  d j t t |  j ƒ ƒ f S(   Ns   %s(%s)s   , (   R~   Rt   t   mapRn   R   (   RV   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   generateÖ   s    (   R@   RA   Rˆ   RŠ   (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyR‡   Ó   s   	t
   PyBinaryOpc           B   s   e  Z d Z d „  Z RS(   R‚   R†   t   *t   /c         S   s"   d |  j  d |  j |  j  d f S(   Ns   %s %s %si    i   (   R   R~   (   RV   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRŠ   Û   s    (   R‚   R†   RŒ   R   (   R@   RA   Rq   RŠ   (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyR‹   Ù   s   s   4 + 5s   getitem('', 'join')s   setattr('x', 'y', 3)s   12 - 1s   ==s   %(py0)s == %(py3)st	   codelinesR   RK   s   assert %(py5)sR   (    (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   Ri   RŠ   R   R   R   R   R   R   R   R   R   (   RV   R}   t   existingR‡   R‹   t   opRŽ   R:   R   RO   R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_viewtype_class_hierarchyÆ   s    %   l   (   R@   RA   Rk   R|   R‘   (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRg   §   s   		c           C   s"   t  j j t  j j t  j j d  S(   N(   R    t   codet   _AssertionErrort   _reinterpret_oldt   _reinterpret(    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_underscore_apiâ   s    

c         C   s§  t  j d ƒ } |  j | d d „  ƒ yž d } d } | | k } | s´ t j d | f d | | f ƒ i t j | ƒ d 6t j | ƒ d	 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } } WnÝ t k
 r¢t	 ƒ  } t
 | ƒ } d } | | k } | s•t j d | f d | | f ƒ i t j | ƒ d 6d t j ƒ  k sRt j | ƒ rat j | ƒ n d d 6}	 d i |	 d 6}
 t t j |
 ƒ ƒ ‚ n  d  } } n Xd  S(   Ns   _pytest.assertion.utilt   _reprcomparec          W   s   d S(   Nt   hello(    (   R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   <lambda>ê   s    i   i   s   ==s   %(py1)s == %(py4)sR8   R   R	   s   assert %(py6)sR   R˜   R7   s   %(py1)s in %(py3)sR   RK   s   assert %(py5)sR   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R7   (   s   %(py1)s in %(py3)ss   assert %(py5)s(   t   pytestRh   R„   R   R   R   R   R   R   R   R   R   R   R   (   t   monkeypatcht   utilR9   R   R:   R;   R    R   R   RO   R   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt$   test_assert_customizable_reprcompareç   s*        E   	   l   c          C   se  yÊ d  d d g f g }  t |  k } | s¿ t j d | f d t |  f ƒ i d t j ƒ  k sl t j t ƒ r{ t j t ƒ n d d 6t j |  ƒ d 6} d i | d
 6} t t j	 | ƒ ƒ ‚ n  d  } }  Wn”t k
 r`t
 ƒ  } t | ƒ } d } | | k }  |  sœt j d |  f d | | f ƒ i t j | ƒ d 6d t j ƒ  k sYt j | ƒ rht j | ƒ n d d 6} d i | d
 6} t t j	 | ƒ ƒ ‚ n  d  } }  d } | | k }  |  sSt j d |  f d | | f ƒ i t j | ƒ d 6d t j ƒ  k st j | ƒ rt j | ƒ n d d 6} d i | d
 6} t t j	 | ƒ ƒ ‚ n  d  } }  n Xd  S(   Ns
   somet texts	   more texts   ==s   %(py0)s == %(py3)sRI   R   RK   R	   s   assert %(py5)sR   s   re-runs   not ins   %(py1)s not in %(py3)sR8   R   R7   s   %(py1)s in %(py3)s(   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   s   not in(   s   %(py1)s not in %(py3)ss   assert %(py5)s(   R7   (   s   %(py1)s in %(py3)ss   assert %(py5)s(   R   RI   R   R   R   R   R   R   R   R   R   R   (   R:   R   RO   R   R   R   R9   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_long_source_1ò   s2       l   	   l   
   l   c          C   se  yÊ d  d d g f g }  t |  k } | s¿ t j d | f d t |  f ƒ i d t j ƒ  k sl t j t ƒ r{ t j t ƒ n d d 6t j |  ƒ d 6} d i | d
 6} t t j	 | ƒ ƒ ‚ n  d  } }  Wn”t k
 r`t
 ƒ  } t | ƒ } d } | | k }  |  sœt j d |  f d | | f ƒ i t j | ƒ d 6d t j ƒ  k sYt j | ƒ rht j | ƒ n d d 6} d i | d
 6} t t j	 | ƒ ƒ ‚ n  d  } }  d } | | k }  |  sSt j d |  f d | | f ƒ i t j | ƒ d 6d t j ƒ  k st j | ƒ rt j | ƒ n d d 6} d i | d
 6} t t j	 | ƒ ƒ ‚ n  d  } }  n Xd  S(   Ns
   somet texts	   more texts   ==s   %(py0)s == %(py3)sRI   R   RK   R	   s   assert %(py5)sR   s   re-runs   not ins   %(py1)s not in %(py3)sR8   R   R7   s   %(py1)s in %(py3)s(   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   s   not in(   s   %(py1)s not in %(py3)ss   assert %(py5)s(   R7   (   s   %(py1)s in %(py3)ss   assert %(py5)s(   R   RI   R   R   R   R   R   R   R   R   R   R   (   R:   R   RO   R   R   R   R9   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_long_source_2ý   s2       l   	   l   
   l   c         C   s6   |  j  d ƒ |  j ƒ  } | j j d d d g ƒ d  S(   Nsƒ   
    import sys
    EX = AssertionError
    def test_hello():
        raise EX("hello"
            "multi"
            "line")
    s   *def test_hello*s
   *raise EX*s
   *1 failed*(   t
   makepyfilet	   runpytestt   stdoutt   fnmatch_lines(   t   testdirt   result(    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_raise_alias  s    	s   sys.version_info < (2,5)c             sÁ  d t  f ‡  f d †  ƒ  Y‰  y ˆ  d ƒ ‚ WnŽt  k
 r¼t t ƒ  ƒ }  d } | |  k } | sø t j d | f d | |  f ƒ i t j | ƒ d 6d t j ƒ  k sµ t j |  ƒ rÄ t j |  ƒ n d d	 6} d i | d 6} t  t j	 | ƒ ƒ ‚ n  d  } } d } | |  k } | s¯t j d | f d | |  f ƒ i t j | ƒ d 6d t j ƒ  k slt j |  ƒ r{t j |  ƒ n d d	 6} d i | d 6} t  t j	 | ƒ ƒ ‚ n  d  } } n Xd  S(   Nt   SomeExc              s   e  Z ‡  f d  †  Z RS(   c            s   t  ˆ  |  ƒ j ƒ  d  S(   N(   t   superR€   (   RV   R   (   R§   (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyR€     s    (   R@   RA   R€   (    (   R§   (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyR§     s   R˜   s   re-runs   not ins   %(py1)s not in %(py3)sR8   R   RK   R	   s   assert %(py5)sR   s   could not determineR7   s   %(py1)s in %(py3)s(   s   not in(   s   %(py1)s not in %(py3)ss   assert %(py5)s(   R7   (   s   %(py1)s in %(py3)ss   assert %(py5)s(   R   R   R   R   R   R   R   R   R   R   R   (   R   R9   R:   RO   R   (    (   R§   sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   test_assert_raise_subclass  s&       l   
   l   c             sG  d t  f ‡  f d †  ƒ  Y‰  d „  }  y>ˆ  ƒ  } d } | | k  } |  | ƒ } | } | sLt j d | f d | | f ƒ i d t j ƒ  k sž t j ˆ  ƒ r­ t j ˆ  ƒ n d d 6t j | ƒ d 6t j | ƒ d	 6} d
 d i d t j ƒ  k st j |  ƒ rt j |  ƒ n d d 6| d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } } } } WnÝ t k
 rBt
 ƒ  } t | ƒ }	 d }
 |
 |	 k } | s5t j d | f d |
 |	 f ƒ i t j |
 ƒ d 6d t j ƒ  k sòt j |	 ƒ rt j |	 ƒ n d d 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  }
 } n Xd  S(   Nt   Ac              s)   e  Z d  „  Z ‡  f d †  Z d „  Z RS(   c         S   s   t  d ƒ ‚ d  S(   Ni*   (   t
   ValueError(   RV   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   __nonzero__'  s    c            s   ˆ  ƒ  S(   N(    (   RV   t   other(   Rª   (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   __lt__)  s    c         S   s   d S(   Ns   <MY42 object>(    (   RV   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRW   +  s    (   R@   RA   R¬   R®   RW   (    (   Rª   (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyRª   &  s   	c         S   s   t  S(   N(   t   True(   RR   (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   myany-  s    i    t   <s(   %(py3)s
{%(py3)s = %(py1)s()
} < %(py6)sR8   RK   R   R	   s2   assert not %(py10)s
{%(py10)s = %(py0)s(%(py8)s)
}R°   R   R"   t   py10s   <MY42 object> < 0R7   s   %(py1)s in %(py3)sR   s   assert %(py5)sR   (   R±   (   s(   %(py3)s
{%(py3)s = %(py1)s()
} < %(py6)s(   R7   (   s   %(py1)s in %(py3)ss   assert %(py5)s(   RD   R   R   R   R   R   R   R   R   R   R   R   (   R°   R:   R   R   RZ   t   @py_assert11R    R[   R   R   R9   RO   R   (    (   Rª   sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt6   test_assert_raises_in_nonzero_of_object_pytest_issue10%  s.    		      | \  	   l   (    (    (&   t   __builtin__R   t   _pytest.assertion.rewritet	   assertiont   rewriteR   Rš   R    R   R   R!   R3   R4   R5   R<   R>   R'   t   markt   skipifRE   RH   RP   RT   RU   R]   R_   R`   Rc   Re   Rf   Rg   R–   R   Rž   RŸ   R¦   R©   R´   (    (    (    sA   /home/ronny/Projects/pytest-dev/py/testing/code/test_assertion.pyt   <module>   s:     														
	
		
			;				