ó
|‰ãWLx  c           @   s«  d  d l  Z d  d l j j Z d  d l Z d  d l m Z m	 Z	 e j
 j d d ƒ Z e j j j d ƒ Z d  d l m Z y d  d l Z Wn e k
 r£ d Z n Xe e d d ƒ Z d  d l Z e e e e j j d ƒ d	  ƒ ƒ Z d
 d d „  ƒ  YZ d „  Z  d „  Z! d „  Z" d „  Z# d „  Z$ d d  d „  ƒ  YZ% d „  Z& d „  Z' d „  Z( d „  Z) d „  Z* d „  Z+ d „  Z, d „  Z- d „  Z. d „  Z/ d d! d „  ƒ  YZ0 d S("   iÿÿÿÿN(   t   FormattedExcinfot   ReprExceptionInfot   queuet   Queues   sys.platform.startswith('java')(   t   astonlyt   invalidate_cachest   .i   t   TWMockc           B   s5   e  Z d  „  Z d d „ Z d „  Z d „  Z d Z RS(   c         C   s   g  |  _  d  S(   N(   t   lines(   t   self(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   __init__   s    c         C   s   |  j  j | | f ƒ d  S(   N(   R   t   append(   R	   t   sept   line(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR      s    c         K   s   |  j  j | ƒ d  S(   N(   R   R   (   R	   R   t   kw(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR      s    c         K   s   | S(   N(    (   R	   t   textR   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   markup   s    iP   N(   t   __name__t
   __module__R
   t   NoneR   R   R   t	   fullwidth(    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR      s
   			c          C   s"  y
 t  ‚ Wn  t  k
 r, t j j ƒ  }  n X|  j } | t  k } | st j d | f d | t  f ƒ i d t j ƒ  k sŠ t j	 |  ƒ r™ t j
 |  ƒ n d d 6t j
 | ƒ d 6d t j ƒ  k sÑ t j	 t  ƒ rà t j
 t  ƒ n d d 6} d i | d
 6} t t j | ƒ ƒ ‚ n  d  } } d  S(   Ns   ==s,   %(py2)s
{%(py2)s = %(py0)s.type
} == %(py4)st   infot   py0t   py2t
   ValueErrort   py4t    s   assert %(py6)st   py6(   s   ==(   s,   %(py2)s
{%(py2)s = %(py0)s.type
} == %(py4)ss   assert %(py6)s(   R   t   pyt   codet   ExceptionInfot   typet
   @pytest_art   _call_reprcomparet   @py_builtinst   localst   _should_repr_global_namet	   _safereprt   AssertionErrort   _format_explanationR   (   R   t   @py_assert1t   @py_assert3t   @py_format5t   @py_format7(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_excinfo_simple    s    
	   £   c    	         s  d „  ‰  ‡  f d †  }  y |  ƒ  Wn  t  k
 rE t j j ƒ  } n Xt j j |  ƒ j d d t j j |  ƒ j d d t j j ˆ  ƒ j d d g } t | j ƒ } g  | D] } | j ^ q° } | | k } | s“t	 j
 d | f d | | f ƒ i d t j ƒ  k st	 j | ƒ r(t	 j | ƒ n d d 6d	 t j ƒ  k sPt	 j | ƒ r_t	 j | ƒ n d	 d
 6} d i | d 6} t t	 j | ƒ ƒ ‚ n  d  } d  S(   Nc           S   s
   t  ‚ d  S(   N(   R   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   g(   s    c              s   ˆ  ƒ  d  S(   N(    (    (   R-   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   f*   s    i   i   s   ==s   %(py0)s == %(py2)st   foundlinenumbersR   t   linenumbersR   R   s   assert %(py4)sR   (   s   ==(   s   %(py0)s == %(py2)ss   assert %(py4)s(   R   R   R   R   t
   getrawcodet   co_firstlinenot   listt	   tracebackt   linenoR    R!   R"   R#   R$   R%   R&   R'   R   (	   R.   t   excinfoR0   t   lt   xR/   R(   t   @py_format3R*   (    (   R-   s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_excinfo_getstatement'   s"    	   “   c           C   s
   t  ‚ d  S(   N(   R   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR.   ;   s    c          C   s   t  }  t ƒ  d  S(   N(   t   TrueR.   (   t   __tracebackhide__(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR-   ?   s    c           C   s   t  ƒ  d  S(   N(   R-   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   hD   s    t   TestTraceback_f_g_hc           B   s‰   e  Z d  „  Z d „  Z d „  Z e e d „  ƒ ƒ Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z RS(   c         C   s5   y t  ƒ  Wn# t k
 r0 t j j ƒ  |  _ n Xd  S(   N(   R=   R   R   R   R   R6   (   R	   t   method(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   setup_methodJ   s    c         C   sò  |  j  j } t | ƒ } 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  } } } 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  } } } d d d g } x< | D]4 }	 y | j |	 j j j ƒ WqJt k
 r}qJXqJW| }
 |
 sèd i d t j ƒ  k s¶t j | ƒ rÅt j	 | ƒ n d d 6} t
 t j | ƒ ƒ ‚ n  d  }
 d  S(   Ni   s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)st   lenR   t   tbt   py1t   py3R   R   s   assert %(py8)st   py8t   entriesR.   R-   R=   s   assert not %(py0)st   names(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)ss   assert not %(py0)s(   R6   R4   R3   RA   R    R!   R"   R#   R$   R%   R&   R'   R   t   removet   frameR   t   nameR   (   R	   RB   RF   t   @py_assert2t   @py_assert5t   @py_assert4R+   t   @py_format9RG   t   entryR(   t   @py_format2(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_traceback_entriesP   s:        ³       ³     A  c         C   sž  |  j  j } t | d j ƒ  ƒ } | j } d } | | ƒ } | sÐ d d i d t j ƒ  k sn t j | ƒ r} t j	 | ƒ n d d 6t j	 | ƒ d 6t j	 | ƒ d 6t j	 | ƒ d	 6} t
 t j | ƒ ƒ ‚ n  d  } } } | j } d
 } | | ƒ } | sŒd d i d t j ƒ  k s*t j | ƒ r9t j	 | ƒ n d d 6t j	 | ƒ d 6t j	 | ƒ d 6t j	 | ƒ d	 6} t
 t j | ƒ ƒ ‚ n  d  } } } d  S(   Niÿÿÿÿs   def f():R   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}t   sR   R   R   R   s   raise ValueErrorsJ   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.endswith
}(%(py4)s)
}(   R6   R4   t   strt	   getsourcet
   startswithR"   R#   R    R$   R%   R&   R'   R   t   endswith(   R	   RB   RR   R(   R)   RL   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_traceback_entry_getsource]   s     	    u  	    u  c         B   s%  e  j j d ƒ } y | j ƒ  d  UWnúe k
 r e  j j ƒ  j } | d j ƒ  GHe | d j ƒ  ƒ } | j	 } d } | | ƒ } | sd d i d e
 j ƒ  k s· e j | ƒ rÆ e j | ƒ n d d 6e j | ƒ d 6e j | ƒ d	 6e j | ƒ d
 6} e e j | ƒ ƒ ‚ n  d  } } } | j } | ƒ  } | j } d } | | ƒ }	 |	 sd d i e j | ƒ d 6d e
 j ƒ  k s•e j | ƒ r¤e j | ƒ n d d 6e j | ƒ d 6e j | ƒ d	 6e j | ƒ d
 6e j |	 ƒ d 6}
 e e j |
 ƒ ƒ ‚ n  d  } } } } }	 n Xd  S(   Ns§               def xyz():
                try:
                    raise ValueError
                except somenoname:
                    pass
            xyz()
        iÿÿÿÿs   def xyz():
    try:R   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}RR   R   R   R   R   s   except somenoname:s~   assert %(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.strip
}()
}.endswith
}(%(py8)s)
}RE   t   py10(   R   R   t   Sourcet   compilet	   NameErrorR   R4   RT   RS   RU   R"   R#   R    R$   R%   R&   R'   R   t   stripRV   (   R	   t   sourceRB   RR   R(   R)   RL   R+   t   @py_assert7t   @py_assert9t   @py_format11(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt+   test_traceback_entry_getsource_in_constructc   s0    			    u  	 	 	    •  c         C   s…  t  j j t ƒ } | j | j } } |  j j } | j d | d | ƒ } t	 | ƒ } d } | | k } | sI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  } } } | j d | d | d ƒ } t	 | ƒ } d } | | k } | ss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  } } } d  S(   Nt   patht   firstlinenoi   s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sRA   R   t   newtracebackRC   RD   R   R   s   assert %(py8)sRE   R5   i   (   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   R   R   t   CodeR.   Rb   Rc   R6   R4   t   cutRA   R    R!   R"   R#   R$   R%   R&   R'   R   (   R	   t   coRb   Rc   R4   Rd   RK   RL   RM   R+   RN   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_traceback_cutw   s*        ³       ³   c         C   s.  | j  d ƒ } t j j t d ƒ } t j j t j j ƒ j ƒ  } | j	 j
 d | ƒ } x³| D]«} t | d ƒ r	t j } | j } | j }	 | |	 ƒ }
 |
 j } | | ƒ } | } | rèd d i	 t j |
 ƒ d 6d t j ƒ  k põ t j t ƒ rt j t ƒ n d d	 6t j | ƒ d
 6t j | ƒ d 6t j | ƒ d 6d t j ƒ  k p\t j | ƒ rnt j | ƒ n d d 6t j | ƒ d 6t j |	 ƒ d 6d t j ƒ  k p³t j | ƒ rÅt j | ƒ n d d 6} t t j | ƒ ƒ ‚ n  t } } }	 }
 } } } n  q^ W| d } | j } | j } | j }	 |	 | k }
 |
 rt j d f |
 f d f |	 | f ƒ i d t j ƒ  k pŠt j | ƒ rœt j | ƒ 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(   Ns   def f(): raise ValueErrors   p.pyimport().f()t   excludepathRb   R   s½   assert not %(py14)s
{%(py14)s = %(py11)s
{%(py11)s = %(py9)s
{%(py9)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.path
}.local
}(%(py7)s
{%(py7)s = %(py5)s.path
})
}.relto
}(%(py12)s)
}t   py9R   R   R   t   py11R   R8   t   py5t   py14t   py7t   basedirt   py12iÿÿÿÿs   ==sa   %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s
{%(py3)s = %(py1)s.frame
}.code
}.path
} == %(py9)st   pRC   RD   s   assert %(py11)s(   t
   makepyfileR   t   testt   raisesR   Rb   t   localt   __file__t   dirpathR4   Rf   t   hasattrt   reltoR    R%   R"   R#   R$   R&   R'   R   RI   R   R!   (   R	   t   testdirRq   R6   Ro   Rd   R8   R(   R)   t   @py_assert6t   @py_assert8t   @py_assert10t   @py_assert13t   @py_assert15t   @py_format16t   @py_assert0RK   RM   t   @py_format10t   @py_format12(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_traceback_cut_excludepath€   s8    	 	 	  	    ÿ   %
 	 	 	   ¢   c   
      C   sÑ  |  j  j } | j ƒ  } t | ƒ } t | ƒ } d } | | } | | k } | r·t j d f | f d f | | f ƒ i t j | ƒ d 6d t j ƒ  k p¨ t j	 t ƒ rº t j t ƒ n d d 6d t j ƒ  k pß t j	 | ƒ rñ t j | ƒ n d d 6t j | ƒ d	 6t j | ƒ d
 6d t j ƒ  k p6t j	 t ƒ rHt j t ƒ n d d 6d t j ƒ  k pmt j	 | ƒ rt j | ƒ n d d 6} d d i | d 6}	 t
 t j |	 ƒ ƒ ‚ n  t } } } } } d  S(   Ni   s   ==s[   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == (%(py8)s
{%(py8)s = %(py5)s(%(py6)s)
} - %(py10)s)RE   RA   R   t
   ntracebackRC   RX   RD   Rl   R4   R   R   s   assert %(py13)st   py13(   R6   R4   t   filterRA   R    R!   R%   R"   R#   R$   R&   R'   R   (
   R	   R4   R…   RK   R^   R_   t   @py_assert11RM   Rƒ   t   @py_format14(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_traceback_filterŠ   s       
   ÿ 8   c            s÷   ‡  f d †  ‰  t  j j t ˆ  d ƒ } | j } | 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 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } } d  S(   Nc            s'   |  d k  r |  d 7}  n  ˆ  |  ƒ d  S(   Ni
   i   (    (   t   n(   R.   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR.      s    i   i   s   ==s   %(py0)s == %(py3)st   recindexR   RD   R   s   assert %(py5)sRl   (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   R   Rs   Rt   t   RuntimeErrorR4   t   recursionindexR    R!   R"   R#   R$   R%   R&   R'   R   (   R	   R6   R4   RŒ   RK   R(   t   @py_format4t   @py_format6(    (   R.   s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_traceback_recursion_index   s    	   l   c   
         su  ‡  f d †  ‰  t  j t ˆ  d ƒ } | j | j j d ƒ | j ƒ  } d } | j } t | ƒ } | | k } | s_t	 j
 d | f d | | f ƒ i t	 j | ƒ d 6t	 j | ƒ d 6d	 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 6} d i | d 6}	 t t	 j |	 ƒ ƒ ‚ n  d  } } } } d  S(   Nc            s-   |  d k r t  d ƒ ‚ n  ˆ  |  d ƒ d  S(   Ni    t   helloi   (   R   (   R‹   (   R.   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR.   š   s    id   RŽ   s   RuntimeError: hellot   insO   %(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.reprcrash
})
}RE   RC   RS   RD   t   reprR   R   R   s   assert %(py10)sRX   (   R“   (   sO   %(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.reprcrash
})
}s   assert %(py10)s(   t   pytestRt   R   t   delattrR4   t	   __class__t   getreprt	   reprcrashRS   R    R!   R%   R"   R#   R$   R&   R'   R   (
   R	   t   monkeypatchR6   R”   R   RL   R^   RK   RN   R`   (    (   R.   s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt-   test_traceback_only_specific_recursion_errors™   s     	    Ã   c            s)  d „  ‰  d „  ‰ ‡  ‡ f d †  } t  j j t | d ƒ } | j } | j ƒ  } | d  k } | st j d | f d | d  f ƒ i d t	 j
 ƒ  k s¥ t j | ƒ r´ t j | ƒ n d d 6d	 t	 j
 ƒ  k sÜ t j d  ƒ rë t j d  ƒ n d	 d
 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  } d  S(   Nc           S   s
   t  ‚ d  S(   N(   R   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   do_stuff¥   s    c          S   s;   d d  l  }  |  j ƒ  \ } } } t j j | | | ƒ d  S(   Niÿÿÿÿ(   t   syst   exc_infoR   t   builtint   _reraise(   R   t   exct   valRB   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt
   reraise_me§   s    c            s    y ˆ  ƒ  Wn ˆ ƒ  n Xd  S(   N(    (   R‹   (   Rœ   R£   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR.   «   s    i   t   iss   %(py0)s is %(py2)sRŒ   R   R   R   R   s   assert %(py4)sR   (   R¤   (   s   %(py0)s is %(py2)ss   assert %(py4)s(   R   Rs   Rt   R   R4   RŽ   R   R    R!   R"   R#   R$   R%   R&   R'   (   R	   R.   R6   R4   RŒ   R(   R9   R*   (    (   Rœ   R£   s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt!   test_traceback_no_recursion_index¤   s    			  “   c         C   s‰  t  j j d ƒ j } d „  } | | ƒ } d „  } | | | ƒ ƒ } t  j j t | ƒ } | j } | j } | ƒ  } | d  k } | sst	 j
 d | f d | d  f ƒ i d t j ƒ  k sÉ t	 j | ƒ rØ t	 j | ƒ n d d 6d t j ƒ  k s t	 j d  ƒ rt	 j d  ƒ n d d	 6t	 j | ƒ d
 6t	 j | ƒ d 6t	 j | ƒ d 6}	 d i |	 d 6}
 t t	 j |
 ƒ ƒ ‚ n  d  } } } } d  S(   Nt	   decoratorc         _   s    d | | f GH|  | | Ž  d  S(   Ns   %s %s(    (   R.   t   kR   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   log¹   s    c           S   s   t  d ƒ ‚ d  S(   NR   (   R   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   fail¾   s    R¤   sl   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.traceback
}.recursionindex
}()
} is %(py8)sR6   R   R   RE   R   R   R   R   s   assert %(py10)sRX   (   R¤   (   sl   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.traceback
}.recursionindex
}()
} is %(py8)ss   assert %(py10)s(   R   Rs   t   importorskipR¦   Rt   R   R4   RŽ   R   R    R!   R"   R#   R$   R%   R&   R'   (   R	   R¦   R¨   R©   R6   R(   R)   RL   R^   RN   R`   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_traceback_messy_recursionµ   s    			 	 	   Ã   c            s  d „  ‰ ‡ f d †  ‰ ‡ f d †  ‰  ‡  f d †  } t  j j t | ƒ } | j } | j ƒ  } t  j j ˆ ƒ } | j } | j } | j	 } | j	 }	 | |	 k }
 |
 s¤t
 j d |
 f d | |	 f ƒ i d t j ƒ  k sê t
 j | ƒ rù t
 j | ƒ n d d 6d	 t j ƒ  k s!t
 j | ƒ r0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 }
 | |
 }	 | |	 k } | sÚt
 j d | f d | |	 f ƒ i d	 t j ƒ  k s0t
 j | ƒ r?t
 j | ƒ n d	 d
 6t
 j |
 ƒ d 6t
 j | ƒ d 6d 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  } } } }
 }	 | j } | j } | j } d } | | k }
 |
 sèt
 j d |
 f d  | | f ƒ i d	 t j ƒ  k set
 j | ƒ rt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("   Nc          S   s   t  }  t ‚ d  S(   N(   R;   R   (   R<   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   iÉ   s    c              s   ˆ  ƒ  d  S(   N(    (    (   R¬   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR=   Ì   s    c             s   t  }  ˆ  ƒ  d  S(   N(   R;   (   R<   (   R=   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR-   Î   s    c              s   ˆ  ƒ  d  S(   N(    (    (   R-   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR.   Ñ   s    s   ==s}   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.frame
}.code
}.path
} == %(py10)s
{%(py10)s = %(py8)s.path
}Rg   RE   RO   R   R   R   R   RX   R   s   assert %(py12)sRp   i   s[   %(py2)s
{%(py2)s = %(py0)s.lineno
} == (%(py6)s
{%(py6)s = %(py4)s.firstlineno
} + %(py8)s)s   assert %(py11)sRk   R=   sa   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.frame
}.code
}.name
} == %(py9)sRj   (   s   ==(   s}   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.frame
}.code
}.path
} == %(py10)s
{%(py10)s = %(py8)s.path
}s   assert %(py12)s(   s   ==(   s[   %(py2)s
{%(py2)s = %(py0)s.lineno
} == (%(py6)s
{%(py6)s = %(py4)s.firstlineno
} + %(py8)s)s   assert %(py11)s(   s   ==(   sa   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.frame
}.code
}.name
} == %(py9)ss   assert %(py11)s(   R   Rs   Rt   R   R4   t   getcrashentryR   Re   RI   Rb   R    R!   R"   R#   R$   R%   R&   R'   R   R5   Rc   RJ   (   R	   R.   R6   RB   RO   Rg   R(   R)   RL   R_   R^   R`   t   @py_format13R‚   Rƒ   R|   (    (   R-   R=   R¬   s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_traceback_getcrashentryÈ   sL    			 	 	 	   Ó   	 	  
   Ã   	 	 	    œ   c            sä  d „  ‰  ‡  f d †  } t  j j t | ƒ } | j } | j ƒ  } t  j j ˆ  ƒ } | j } | j } | j	 } | j	 }	 | |	 k }
 |
 s†t
 j d |
 f d | |	 f ƒ i d t j ƒ  k sÌ t
 j | ƒ rÛ t
 j | ƒ n d 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  } } } }
 }	 | j } | 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	 6d t j ƒ  k sit
 j | ƒ rxt
 j | ƒ n d d
 6t
 j | ƒ d 6} d i | d 6} t t
 j | ƒ ƒ ‚ n  d  } } } }
 }	 | j } | j } | j } d } | | k }
 |
 sÊt
 j d |
 f d | | f ƒ i d t j ƒ  k sGt
 j | ƒ rV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(    Nc          S   s   t  }  t ‚ d  S(   N(   R;   R   (   R<   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR-   Ý   s    c             s   t  }  ˆ  ƒ  d  S(   N(   R;   (   R<   (   R-   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR.   à   s    s   ==s}   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.frame
}.code
}.path
} == %(py10)s
{%(py10)s = %(py8)s.path
}Rg   RE   RO   R   R   R   R   RX   R   s   assert %(py12)sRp   i   s[   %(py2)s
{%(py2)s = %(py0)s.lineno
} == (%(py6)s
{%(py6)s = %(py4)s.firstlineno
} + %(py8)s)s   assert %(py11)sRk   R-   sa   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.frame
}.code
}.name
} == %(py9)sRj   (   s   ==(   s}   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.frame
}.code
}.path
} == %(py10)s
{%(py10)s = %(py8)s.path
}s   assert %(py12)s(   s   ==(   s[   %(py2)s
{%(py2)s = %(py0)s.lineno
} == (%(py6)s
{%(py6)s = %(py4)s.firstlineno
} + %(py8)s)s   assert %(py11)s(   s   ==(   sa   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.frame
}.code
}.name
} == %(py9)ss   assert %(py11)s(   R   Rs   Rt   R   R4   R­   R   Re   RI   Rb   R    R!   R"   R#   R$   R%   R&   R'   R   R5   Rc   RJ   (   R	   R.   R6   RB   RO   Rg   R(   R)   RL   R_   R^   R`   R®   R‚   Rƒ   R|   (    (   R-   s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt"   test_traceback_getcrashentry_emptyÜ   sH    			 	 	 	   Ó   	 	  
   Ã   	 	 	    œ   (   R   R   R@   RQ   RW   R   t   failsonjythonRa   Rh   R„   RŠ   R‘   R›   R¥   R«   R¯   R°   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR>   I   s   						
		
				c         C   s   |  d d  S(   Ni   (    (   R8   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR’   ì   s    c          C   s
  y t  d ƒ Wn  t k
 r0 t j j ƒ  }  n X|  j d } | j ƒ  } | 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  S(   NR’   iÿÿÿÿs   TypeError: ('hello' + 5)R   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}t   msgR   R   R   R   (   R’   t	   TypeErrorR   R   R   R4   t   reinterpretRU   R"   R#   R    R$   R%   R&   R'   R   (   R6   t   tbentryR²   R(   R)   RL   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_tbentry_reinterpretï   s    	    u  c    	      C   s®  t  j j t t ƒ }  |  j } | ƒ  } | j } d } | | ƒ } | sõ d d 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} t t j | ƒ ƒ ‚ n  d  } } } } } t  j j t d ƒ }  |  j d 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  } } } | j } d } | | ƒ } | sœd d i d t	 j
 ƒ  k s:t j | ƒ rIt j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d	 6} t t j | ƒ ƒ ‚ n  d  } } } d  S(   NR   R   s‚   assert %(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.exconly
}()
}.startswith
}(%(py8)s)
}RE   R6   R   R   R   R   RX   s    raise ValueError('hello\nworld')t   tryshortsL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}R²   t   worldsJ   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.endswith
}(%(py4)s)
}(   R   Rs   Rt   R   R=   t   exconlyRU   R    R%   R"   R#   R$   R&   R'   R   R;   RV   (	   R6   R(   R)   RL   R^   R_   R`   R²   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_excinfo_exconlyø   s6    	 	 	    •  		    u  	    u  c          C   sÜ   t  j j t t ƒ }  t |  ƒ } 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 6} d i | d	 6} t t j | ƒ ƒ ‚ n  d  } } d  S(   Ns"   <ExceptionInfo ValueError tblen=4>s   ==s   %(py0)s == %(py3)sRR   R   RD   R   s   assert %(py5)sRl   (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   R   Rs   Rt   R   R=   R”   R    R!   R"   R#   R$   R%   R&   R'   R   (   R6   RR   RK   R(   R   R   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_excinfo_repr  s       l   c          C   s  t  j j t t ƒ }  t |  ƒ } | j } t d  } | | ƒ } | sÓ d d i d t j	 ƒ  k sq t
 j | ƒ r€ t
 j | ƒ n d d 6t
 j | ƒ d 6t
 j | ƒ d 6t
 j | ƒ d 6} t t
 j | ƒ ƒ ‚ n  d  } } } | 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  } } } | j } d } | | ƒ } t | ƒ }	 d }
 |	 |
 k } | sèt
 j d | f d |	 |
 f ƒ i t
 j |	 ƒ d 6d t j	 ƒ  k s.t
 j t ƒ r=t
 j t ƒ n d d 6d t j	 ƒ  k set
 j | ƒ rt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(   Ni÷ÿÿÿR   sL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}RR   R   R   R   R   R   sJ   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.endswith
}(%(py4)s)
}t   :i   s   >=sj   %(py9)s
{%(py9)s = %(py0)s(%(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.split
}(%(py5)s)
})
} >= %(py12)sRj   RA   RC   RD   Rl   Rn   Rp   s   assert %(py14)sRm   (   s   >=(   sj   %(py9)s
{%(py9)s = %(py0)s(%(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.split
}(%(py5)s)
})
} >= %(py12)ss   assert %(py14)s(   R   Rs   Rt   R   R=   RS   RU   Rv   R"   R#   R    R$   R%   R&   R'   R   RV   t   splitRA   R!   (   R6   RR   R(   R)   RL   R+   RK   RM   R{   R|   Rˆ   R}   R®   t   @py_format15(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_excinfo_str  s6    	 
   u  	    u  	       ã   c          C   sò   t  j j t t ƒ }  |  j } | t ƒ } | sä d d i d t j ƒ  k s[ t j	 |  ƒ rj t j
 |  ƒ n d d 6t j
 | ƒ d 6d t j ƒ  k s¢ t j	 t ƒ r± t j
 t ƒ n d d 6t j
 | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } d  S(	   NR   sO   assert %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s.errisinstance
}(%(py3)s)
}R6   R   R   R   RD   Rl   (   R   Rs   Rt   R   R=   t   errisinstanceR"   R#   R    R$   R%   R&   R'   R   (   R6   R(   RM   R   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_excinfo_errisinstance  s    	   œ  c          B   sÌ  y d d  UWn  e  k
 r. e j j ƒ  }  n Xe |  j d ƒ } e j j j d k  rd } | | k } | se	 j
 d | f d | | f ƒ i d e j ƒ  k s± e	 j | ƒ rÀ e	 j | ƒ n d d	 6e	 j | ƒ d
 6} d i | d 6} e e	 j | ƒ ƒ ‚ n  d  } } n· d } | | k } | s¾e	 j
 d | f d | | f ƒ i d e j ƒ  k ske	 j | ƒ rze	 j | ƒ n d d	 6e	 j | ƒ d
 6} d i | d 6} e e	 j | ƒ ƒ ‚ n  d  } } d  S(   Ns   raise ValueError()iÿÿÿÿi   i   s     File '<string>':1 in ?
  ???
s   ==s   %(py0)s == %(py3)sRR   R   RD   R   s   assert %(py5)sRl   s&     File '<string>':1 in <module>
  ???
(   i   i   (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   R   R   R   R   RS   R4   t   stdR   t   version_infoR    R!   R"   R#   R$   R%   R&   R'   R   (   R6   RR   RK   R(   R   R   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_excinfo_no_sourcecode  s(       l      l   c         C   sà  |  j  d ƒ j d ƒ t j j d ƒ } | j t |  ƒ ƒ } | j d | ƒ } | j d ƒ } t j j	 t
 | j d t ƒ} x]| j D]R} | GH| j | j j d k r† | j } 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 sP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  } } }
 }	 q† q† Wd  S(   Ns   test.txts	   {{ h()}}:t   jinja2t   loaderR=   s   ==sL   %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.source
})
} == %(py8)sRS   R   t   itemRC   RE   RD   Rl   R   s   assert %(py10)sRX   (   s   ==(   sL   %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.source
})
} == %(py8)ss   assert %(py10)s(   t   joint   writeR   Rs   Rª   t   FileSystemLoaderRS   t   Environmentt   get_templateRt   R   t   renderR=   R4   R]   Rb   t   basenameR    R!   R"   R#   R$   R%   R&   R'   R   (   t   tmpdirRÅ   RÆ   t   envt   templateR6   RÇ   RK   RM   R^   R{   RN   R`   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt!   test_excinfo_no_python_sourcecode  s(    	     Ã   c    
      C   sÿ  y t  j ƒ  j d d ƒ Wn# t  j k
 r? t j j ƒ  }  n X|  j d } | j ƒ  } | d  k	 } | s't
 j d | f d | d  f ƒ i d t j ƒ  k s­ t
 j | ƒ r¼ t
 j | ƒ n d d 6d t j ƒ  k sä t
 j d  ƒ ró t
 j d  ƒ n d d	 6} d i | d 6} t t
 j | ƒ ƒ ‚ n  d  } t | ƒ j ƒ  } | 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  S(   Nt   timeoutgü©ñÒMbP?iÿÿÿÿs   is nots   %(py0)s is not %(py2)sR]   R   R   R   R   s   assert %(py4)sR   s   def getsL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}RR   R   (   s   is not(   s   %(py0)s is not %(py2)ss   assert %(py4)s(   R   R   t   gett   EmptyR   R   R   R4   RT   R   R    R!   R"   R#   R$   R%   R&   R'   RS   R\   RU   (
   R6   RO   R]   R(   R9   R*   RR   R)   RL   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_entrysource_Queue_example-  s(      “   	    u  c          C   s7  y t  j ƒ  j d d ƒ Wn# t  j k
 r? t j j ƒ  }  n X|  j d } | j } t j } | j	 } t
 | | ƒ } | sxd d i t j | ƒ d 6d 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
 6d t j ƒ  k s&t j t ƒ r5t j t ƒ n d d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } } | j } | 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 6t j | ƒ d 6}	 d i |	 d 6}
 t t j |
 ƒ ƒ ‚ n  d  } } } } } | j } | ƒ  } | s)d d i d	 t j ƒ  k s×t j | ƒ ræt j | ƒ n d	 d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } d  S(   NRÓ   gü©ñÒMbP?iÿÿÿÿR   sj   assert %(py8)s
{%(py8)s = %(py0)s(%(py1)s, %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s.path
}.local
})
}RE   t
   isinstanceR   Rb   RC   R   R   R   R   s   queue.pys   ==sb   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.basename
}.lower
}()
} == %(py9)sRj   s   assert %(py11)sRk   s@   assert %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.check
}()
}(   s   ==(   sb   %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.basename
}.lower
}()
} == %(py9)ss   assert %(py11)s(   R   R   RÔ   RÕ   R   R   R   R4   Rb   Ru   R×   R    R%   R"   R#   R$   R&   R'   R   RÎ   t   lowerR!   t   check(   R6   RO   Rb   R)   RL   R^   RN   R(   R|   R‚   Rƒ   R*   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_codepath_Queue_example8  s:    		 	   ã  	 	 	    œ   	 	  e  t   TestFormattedExcinfoc        
   B   s–  e  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 „  Z d „  Z e j j j d g  d& D]a Z  e! e" f D]N Z# e! e" f D]; Z$ e! e" f D]( Z% i e  d 6e# d  6e% d! 6e$ d" 6^ q?q/qqƒ d# „  ƒ Z& d$ „  Z' d% „  Z( RS('   c            s   ‡  f d †  } | S(   Nc            sj   t  j j |  ƒ }  ˆ  j d ƒ } | j d ƒ } | j d ƒ | j |  ƒ t d  k	 r` t ƒ  n  | j	 ƒ  S(   NRÏ   s   mod.pys   __init__.py(
   R   R   RY   t   getfuncargvalueRÈ   t   ensureRÉ   t   invalidate_import_cachesR   t   pyimport(   R]   RÏ   t   modpath(   t   request(    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   importasmodE  s    
(    (   R	   Rá   Râ   (    (   Rá   s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   pytest_funcarg__importasmodD  s    	c         B   s¦   e  j j | ƒ j ƒ  } y | j ƒ  d  UWn$ e k
 r@ ‚  n e  j j ƒ  SXd } | sœ e j d ƒ d i e j	 | ƒ d 6} e
 e j | ƒ ƒ ‚ n  d  } d  S(   Ni    s   did not raises   
>assert %(py1)sRC   (   R   R   RY   R\   RZ   t   KeyboardInterruptR   R    t   _format_assertmsgR%   R&   R'   R   (   R	   R]   R   RP   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   excinfo_from_execP  s      '  c         C   sŠ  t  ƒ  } t j j d ƒ j ƒ  } d | _ | j | d ƒ } 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  } } } | 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  }	 } }
 | d }	 d }
 |	 |
 k } | sxt j	 d | f d |	 |
 f ƒ i t j |	 ƒ d
 6t j |
 ƒ d 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  }	 } }
 d  S(   Ns4   
            def f(x):
                pass
        t   |i    i   s   ==s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)sRA   R   R   RC   RD   R   R   s   assert %(py8)sRE   s   |   def f(x):s   %(py1)s == %(py4)sR   s   assert %(py6)si   s           pass(   s   ==(   s0   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} == %(py6)ss   assert %(py8)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R    R   R   RY   R\   t   flow_markert
   get_sourceRA   R    R!   R"   R#   R$   R%   R&   R'   R   (   R	   t   prR]   R   RK   RL   RM   R+   RN   R   R)   R*   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_sourceZ  s:    			    ³   
    E   
    E   c   	      C   s  t  ƒ  } |  j d ƒ } t  ƒ  } | j | j d ƒ } | j | d | ƒ } d d d g } | | 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 6} d i | d 6} t t j | ƒ ƒ ‚ n  d } } d S(   s    check if indentation is right sS   
                def f():
                    assert 0
                f()
        iÿÿÿÿi   s       def f():s   >       assert 0s   E       assert 0s   ==s   %(py0)s == %(py3)sR   R   RD   R   s   assert %(py5)sRl   N(   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   R    Ræ   t   _getentrysourceR4   Ré   R    R!   R"   R#   R$   R%   R&   R'   R   (	   R	   Rê   R6   R]   R   RK   R(   R   R   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_source_excinfof  s    			   l   c   
      B   s  e  ƒ  } e d d d ƒ } y | d  UWn  e k
 rI e j j ƒ  } n X| j | ƒ } | j j d j	 d } d } | | k } | sö e
 j d | f d | | f ƒ i e
 j | ƒ d	 6e
 j | ƒ d
 6} d i | d 6}	 e e
 j |	 ƒ ƒ ‚ n  d  } } } d  S(   Ns   raise ValueError()R   t   execi   i    s   >   ???s   ==s   %(py1)s == %(py4)sRC   R   s   assert %(py6)sR   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R    RZ   R   R   R   R   t   repr_excinfot   reprtracebackt   reprentriesR   R    R!   R%   R&   R'   R   (
   R	   Rê   Rg   R6   R”   R   R)   RK   R*   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_source_not_existingx  s    	    E   c   
      B   s  e  ƒ  } e d d d ƒ } y | d  UWn  e k
 rI e j j ƒ  } n X| j | ƒ } | j j d j	 d } d } | | k } | sö e
 j d | f d | | f ƒ i e
 j | ƒ d	 6e
 j | ƒ d
 6} d i | d 6}	 e e
 j |	 ƒ ƒ ‚ n  d  } } } d  S(   Ns   
a = 1
raise ValueError()
R   Rî   i   i    s   >   ???s   ==s   %(py1)s == %(py4)sRC   R   s   assert %(py6)sR   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R    RZ   R   R   R   R   Rï   Rð   Rñ   R   R    R!   R%   R&   R'   R   (
   R	   Rê   Rg   R6   R”   R   R)   RK   R*   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt'   test_repr_many_line_source_not_existing‚  s     	    E   c            sb  t  ƒ  } d t f d „  ƒ  Y‰  d t f ‡  f d †  ƒ  Y‰ d t j j j f ‡ f d †  ƒ  Y‰ d t j j f ‡ f d †  ƒ  Y} d	 t j j f d
 „  ƒ  Y} | ƒ  } d t f d „  ƒ  Y} | ƒ  } | | ƒ | _ t ƒ  } | j	 | ƒ } | j
 j d j 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  }	 } }
 t j j } | j	 | ƒ } | j
 j d j d }	 d }
 |	 |
 k } | sPt j d | f d |	 |
 f ƒ i t j |	 ƒ d 6t j |
 ƒ d 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  }	 } }
 d  S(   Nt   FakeCodec           B   s<   e  Z d  d d „  ƒ  YZ d Z d Z d „  Z e e ƒ Z RS(   t   rawc           B   s   e  Z d  Z RS(   t   ?(   R   R   t   co_filename(    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyRõ   “  s   Rö   i   c         S   s   d  S(   N(   R   (   R	   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt
   fullsource˜  s    (    (   R   R   Rõ   Rb   Rc   Rø   t   property(    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyRô   ’  s
   	t	   FakeFramec              s   e  Z ˆ  ƒ  Z i  Z i  Z RS(    (   R   R   R   t   f_localst	   f_globals(    (   Rô   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyRú   œ  s   	t   FakeTracebackEntryc              s&   e  Z d  „  Z e ‡  f d †  ƒ Z RS(   c         S   s   d |  _  d  S(   Ni   i   i   (   R5   (   R	   RB   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR
   ¢  s    c            s   ˆ  ƒ  S(   N(    (   R	   (   Rú   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyRI   ¥  s    (   R   R   R
   Rù   RI   (    (   Rú   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyRý   ¡  s   	t	   Tracebackc              s   e  Z ˆ  Z RS(    (   R   R   t   Entry(    (   Rý   (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyRþ   ©  s   t   FakeExcinfoc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   t   Fooc         S   s   d  S(   N(    (   R	   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR
   ®  s    c         S   s   d S(   Nt   EXC(    (   R	   R·   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR¹   ±  s    c         S   s   t  S(   N(   t   False(   R	   t   cls(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyRÀ   ³  s    (   R   R   t   typenameR
   R¹   RÀ   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR   ¬  s   		t	   FakeRawTBc           B   s   e  Z d  Z RS(   N(   R   R   R   t   tb_next(    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR  ·  s   i    s   >   ???s   ==s   %(py1)s == %(py4)sRC   R   R   s   assert %(py6)sR   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R    t   objectR   R   Rþ   Rÿ   R   R4   t   IOErrorRï   Rð   Rñ   R   R    R!   R%   R&   R'   R   t   errort   ENOENT(   R	   Rê   Rþ   R   R6   R  RB   R©   R”   R   R)   RK   R*   R+   (    (   Rô   Rú   Rý   s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt#   test_repr_source_failing_fullsource  s<    	
%"
			    E       E   c         C   sQ  t  d t ƒ } i d d 6d d 6d d 6d d	 6i  d
 6} | j | ƒ } | j } | sÃ d d i d t j ƒ  k s t j | ƒ r t j | ƒ n d d 6t j | ƒ d 6} t	 t j
 | ƒ ƒ ‚ n  d  } | j 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  } } } | j 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  } } } | j 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  } } } | j 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  } } } d  S((   Nt
   showlocalsi   t   yi   t   zi   R8   i   s   @xt   __builtins__R   s)   assert %(py2)s
{%(py2)s = %(py0)s.lines
}t
   reprlocalsR   R   i    s   __builtins__ = <builtins>s   ==s   %(py1)s == %(py4)sRC   R   s   assert %(py6)sR   i   s   x          = 3s   y          = 5s   z          = 7(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R    R;   t   repr_localsR   R"   R#   R    R$   R%   R&   R'   R   R!   (   R	   Rq   t   locR  R(   R9   R   R)   RK   R*   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_localÅ  sP    )	  U      E       E       E       E   c         C   s”  | d ƒ } t  j j t | j ƒ } | j j ƒ  | _ t ƒ  } | j | j d ƒ } | j	 } | 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  } }	 } | 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  } }	 } t d t ƒ } | j | j d | ƒ } | j	 } | 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  } }	 } | 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  } }	 } | 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  } }	 } | d } d } | | k }	 |	 s5t
 j d/ |	 f d0 | | f ƒ i t
 j | ƒ d 6t
 j | ƒ d 6}
 d1 i |
 d 6} t t
 j | ƒ ƒ ‚ n  d  } }	 } | d } | }	 |	 sŒd2 i t
 j | ƒ d 6} t t
 j | ƒ ƒ ‚ n  d  } }	 | j d  k	 } | j } | j } | j } | | k } | s®t
 j d3 | f d4 | | f ƒ i d t j ƒ  k st
 j | ƒ r#t
 j | ƒ n d d 6t
 j | ƒ d 6d t j ƒ  k s[t
 j | ƒ rjt
 j | ƒ n d d 6t
 j | ƒ d 6} d5 i | d 6} t t
 j | ƒ ƒ ‚ n  d  } } } | j } d } | | k } | s‚t
 j d6 | f d7 | | f ƒ i d t j ƒ  k st
 j | ƒ r.t
 j | ƒ n d d 6t
 j | ƒ d 6t
 j | ƒ d 6} d8 i | d 6} t t
 j | ƒ ƒ ‚ n  d  } } } d  S(9   NsS   
            def func1():
                raise ValueError("hello\nworld")
        iÿÿÿÿi    s       def func1():s   ==s   %(py1)s == %(py4)sRC   R   R   s   assert %(py6)sR   i   s(   >       raise ValueError("hello\nworld")R  i   s   E       ValueError: helloi   s   E       worldi   s   assert not %(py1)ssJ   %(py2)s
{%(py2)s = %(py0)s.path
} == %(py6)s
{%(py6)s = %(py4)s.__file__
}R  R   R   t   mods   assert %(py8)sRE   s.   %(py2)s
{%(py2)s = %(py0)s.lineno
} == %(py5)sRl   s   assert %(py7)sRn   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)ss   assert not %(py1)s(   s   ==(   sJ   %(py2)s
{%(py2)s = %(py0)s.path
} == %(py6)s
{%(py6)s = %(py4)s.__file__
}s   assert %(py8)s(   s   ==(   s.   %(py2)s
{%(py2)s = %(py0)s.lineno
} == %(py5)ss   assert %(py7)s(   R   Rs   Rt   R   t   func1R4   R‡   R    t   repr_traceback_entryR   R    R!   R%   R&   R'   R   R;   R  t   reprfilelocRb   Rv   R"   R#   R$   R5   (   R	   Râ   R  R6   Rq   t   reprtbR   R   R)   RK   R*   R+   t
   repr_entryR9   R  R(   RL   RN   RM   R   t   @py_format8(    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_tracebackentry_linesÏ  s¤    			
    E   
    E   	
    E   
    E   
    E   
    E   
     
		 	   ³   	    |   c         C   s­  | d ƒ } t  j j t | j d d d d d d ƒ } | j j ƒ  | _ | j d } t d	 t ƒ } | j	 | ƒ } | j
 d
 } d t d d ƒ f } | | 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  } }	 } | j
 d } d/ } | | k }	 |	 s¹t j d0 |	 f d1 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d2 i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j
 d } d3 } | | k }	 |	 sZt j d4 |	 f d5 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d6 i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j
 d } d t d d ƒ f } | | k }	 |	 st j d7 |	 f d8 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d9 i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } t d	 t ƒ } | j | ƒ } | j } | j
 } | j
 } | | k } | sP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 6d t j ƒ  k st j | ƒ rt j | ƒ n d d 6} d< i | d  6} t t j | ƒ ƒ ‚ n  d  } } } } t ƒ  } | j | ƒ | j d
 } d! } d } d } | | } t | ƒ } | | } | | k }	 |	 sžt j d= |	 f d> | | f ƒ i t j | ƒ d# 6t j | ƒ d$ 6t j | ƒ d 6t j | ƒ d 6d% t j ƒ  k sKt j t ƒ rZt j t ƒ n d% d& 6t j | ƒ d' 6} d? i | d) 6} t t j | ƒ ƒ ‚ n  d  } }	 } } } } } } | j d } d* } | | k }	 |	 sSt j d@ |	 f dA | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 dB i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } d+ } d } d } | | } t | ƒ } | | } | | k }	 |	 s‡t j dC |	 f dD | | f ƒ i t j | ƒ d# 6t j | ƒ d$ 6t j | ƒ d 6t j | ƒ d 6d% t j ƒ  k s4t j t ƒ rCt j t ƒ n d% d& 6t j | ƒ d' 6} dE i | d) 6} t t j | ƒ ƒ ‚ n  d  } }	 } } } } } } d  S(F   Ns]   
            def func1(m, x, y, z):
                raise ValueError("hello\nworld")
        t   miZ   i   i   R  ix   iÿÿÿÿt   funcargsi    s   ==s   %(py1)s == %(py4)sRC   R   R   s   assert %(py6)sR   i   R8   t   5i   R  t   13i   sh   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprfuncargs
}.args
} == %(py8)s
{%(py8)s = %(py6)s.args
}R  R   RE   R   t   reprfuncargss   assert %(py10)sRX   s   m = sJ   %(py1)s == (%(py4)s + %(py12)s
{%(py12)s = %(py5)s((%(py7)s * %(py9)s))
})Rj   Rp   R”   Rl   Rn   s   assert %(py15)st   py15s   x = 5, y = 13s   z = (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R8   R  (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R  R   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   sh   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprfuncargs
}.args
} == %(py8)s
{%(py8)s = %(py6)s.args
}s   assert %(py10)s(   s   ==(   sJ   %(py1)s == (%(py4)s + %(py12)s
{%(py12)s = %(py5)s((%(py7)s * %(py9)s))
})s   assert %(py15)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   sJ   %(py1)s == (%(py4)s + %(py12)s
{%(py12)s = %(py5)s((%(py7)s * %(py9)s))
})s   assert %(py15)s(   R   Rs   Rt   R   R  R4   R‡   R    R;   t	   repr_argst   argsR”   R    R!   R%   R&   R'   R   R  R!  R"   R#   R$   R   t
   toterminalR   (   R	   Râ   R  R6   RO   Rq   R!  R   R)   RK   R*   R+   R  R(   R^   RL   RN   R`   t   twR{   R|   R}   Rˆ   R~   R‰   R€   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR  î  s¬    	,    E       E       E       E   	 	 	   Ã   	    
  
   ¬   "    E       
  
   ¬   c         C   s  | d ƒ } t  j j t | j d d d d ƒ} | j j ƒ  | _ | j d } t d t ƒ } | j	 | ƒ } | j
 d } d	 t d ƒ f } | | 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  } }	 } | j
 d } d t d! ƒ f } | | 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  } }	 } | j
 d } d t i d d 6ƒ f } | | k }	 |	 smt j d% |	 f d& | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d' i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } t d t ƒ } | j | ƒ } | j } | j
 } | j
 } | | 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 6d t j ƒ  k sot j | ƒ r~t j | ƒ n d d 6} d* i | d 6} t t j | ƒ ƒ ‚ n  d  } } } } t ƒ  } | j | ƒ | j d } d } | | k }	 |	 smt j d+ |	 f d, | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d- i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } d  S(.   Ns]   
            def func1(x, *y, **z):
                raise ValueError("hello\nworld")
        t   at   bt   ct   diÿÿÿÿR  i    R8   s   ==s   %(py1)s == %(py4)sRC   R   R   s   assert %(py6)sR   i   R  i   R  sh   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprfuncargs
}.args
} == %(py8)s
{%(py8)s = %(py6)s.args
}R  R   RE   R   R!  s   assert %(py10)sRX   s#   x = 'a', y = ('b',), z = {'c': 'd'}(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R(  (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   sh   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprfuncargs
}.args
} == %(py8)s
{%(py8)s = %(py6)s.args
}s   assert %(py10)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R   Rs   Rt   R   R  R4   R‡   R    R;   R#  R$  R”   R    R!   R%   R&   R'   R   R  R!  R"   R#   R$   R   R%  R   (   R	   Râ   R  R6   RO   Rq   R!  R   R)   RK   R*   R+   R  R(   R^   RL   RN   R`   R&  (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt*   test_repr_tracebackentry_lines_var_kw_args  sh    	$    E       E       E   	 	 	   Ã   	    E   c         C   sr  | d ƒ } t  j j t | j ƒ } t d d ƒ } | j | j d ƒ } | j } t  j	 j
 | j ƒ j } | d } d }	 | |	 k }
 |
 rt j d f |
 f d f | |	 f ƒ i t j | ƒ d	 6t j |	 ƒ d
 6} d d i | d 6} t t j | ƒ ƒ ‚ n  t } }
 }	 | j } | j	 } t | ƒ } | | k } | rqt j d f | f d f | | 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 | ƒ rt j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6} d d i | d 6} t t j | ƒ ƒ ‚ n  t } } } } | j } | j }	 d } |	 | k } | rmt j d f | f d f |	 | f ƒ i d t j ƒ  k pót j | ƒ rt j | ƒ n d d 6t j | ƒ d 6t j |	 ƒ d
 6t j | ƒ d 6} d d i | d 6} t t j | ƒ ƒ ‚ n  t } }	 } } t d d ƒ } | j | j d | ƒ } | j } | d } d }	 | |	 k }
 |
 rKt j d f |
 f d f | |	 f ƒ i t j | ƒ d	 6t j |	 ƒ d
 6} d d i | d 6} t t j | ƒ ƒ ‚ n  t } }
 }	 | d  } d! }	 | |	 k }
 |
 rôt j d f |
 f d f | |	 f ƒ i t j | ƒ d	 6t j |	 ƒ d
 6} d d i | d 6} t t j | ƒ ƒ ‚ n  t } }
 }	 | j } | j	 } t | ƒ } | | k } | r`t j d f | f d f | | 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 | ƒ rt j | ƒ n d d 6t j | ƒ d 6t j | ƒ d 6} d d i | d 6} t t j | ƒ ƒ ‚ n  t } } } } | j } | j }	 d" } |	 | k } | r\t j d f | f d f |	 | f ƒ i d t j ƒ  k pât j | ƒ rôt j | ƒ n d d 6t j | ƒ d 6t j |	 ƒ d
 6t j | ƒ d 6} d d i | d 6} t t j | ƒ ƒ ‚ n  t } }	 } } d  S(#   Ns}   
            def func1():
                raise ValueError("hello")
            def entry():
                func1()
        t   stylet   shortiþÿÿÿi    s       func1()s   ==s   %(py1)s == %(py4)sRC   R   R   s   assert %(py6)sR   R“   sk   %(py0)s in %(py9)s
{%(py9)s = %(py2)s(%(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py3)s.reprfileloc
}.path
})
}Rj   RÎ   R   RS   R   R  RD   Rl   Rn   s   assert %(py11)sRk   i   sO   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprfileloc
}.lineno
} == %(py7)ss   assert %(py9)siÿÿÿÿs       raise ValueError("hello")i   s   E   ValueError: helloi   (   R   Rs   Rt   R   RO   R    R  R4   R   Rb   Ru   Rv   RÎ   R    R!   R%   R&   R'   R   R  RS   R"   R#   R$   R5   (   R	   Râ   R  R6   Rq   R  R   RÎ   R   R)   RK   R*   R+   RM   R{   R|   R(   R‚   Rƒ   RL   R  (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_tracebackentry_short  s    		
    K   	 	    ÿ    	 	    ’   	
    K   
    K   	 	    ÿ    	 	    ’   c         C   sm  | d ƒ } t  j j t | j ƒ } t d d ƒ } | j | j d ƒ t d d ƒ } | j | j d | ƒ } | j } | 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  } }	 } | d } | }	 |	 s_d i t	 j | ƒ d
 6} t t	 j | ƒ ƒ ‚ n  d  } }	 d  S(   Ns}   
            def func1():
                raise ValueError("hello")
            def entry():
                func1()
        R,  t   noiþÿÿÿiÿÿÿÿi    s   E   ValueError: hellos   ==s   %(py1)s == %(py4)sRC   R   R   s   assert %(py6)sR   i   s   assert not %(py1)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)ss   assert not %(py1)s(   R   Rs   Rt   R   RO   R    R  R4   R   R    R!   R%   R&   R'   R   (   R	   Râ   R  R6   Rq   t	   reprentryR   R   R)   RK   R*   R+   R9   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_tracebackentry_no4  s,    		
    E   
     c         C   sº  | d ƒ } t  j j t | j ƒ } t d t ƒ } | j | ƒ } | j } 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 6t
 j | ƒ d 6}
 d i |
 d 6} t t
 j | ƒ ƒ ‚ n  d  } } }	 } t d t ƒ } | j | ƒ } | j } 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 s1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  } } }	 } d  S(   Nsq   
            def f(x):
                raise ValueError(x)
            def entry():
                f(0)
        t   tbfilteri   s   ==sQ   %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.reprentries
})
} == %(py8)sRA   R   R  RC   RE   RD   Rl   R   s   assert %(py10)sRX   i   (   s   ==(   sQ   %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.reprentries
})
} == %(py8)ss   assert %(py10)s(   s   ==(   sQ   %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.reprentries
})
} == %(py8)ss   assert %(py10)s(   R   Rs   Rt   R   RO   R    R;   t   repr_tracebackRñ   RA   R    R!   R"   R#   R$   R%   R&   R'   R   R  (   R	   Râ   R  R6   Rq   R  RK   RM   R^   R{   RN   R`   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_traceback_tbfilterE  s2    		     Ã   	     Ã   c         C   sÕ  | d ƒ } y | j  ƒ  Wn  t k
 r< t j j ƒ  } n Xd d l m } | j | d d ƒ d | j d j	 j _
 t d d ƒ } | j | j d	 ƒ } | j } t d d ƒ }	 |	 j | j d | ƒ }
 |
 j } | j ƒ  t j
 j | j ƒ j } | 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  } } } | 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  } } } | 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  } } } d  S(   Ns}   
            def func1():
                raise ValueError("hello")
            def entry():
                func1()
        iÿÿÿÿ(   Re   Rb   t   bogusi    R,  R-  iþÿÿÿs       func1()s   ==s   %(py1)s == %(py4)sRC   R   R   s   assert %(py6)sR   s       raise ValueError("hello")i   s   E   ValueError: hello(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   RO   R   R   R   R   t   py._code.codeRe   t   setattrR4   RI   Rb   R    R  R   t   undoRu   Rv   RÎ   R    R!   R%   R&   R'   R   (   R	   Râ   Rš   R  R6   Re   Rq   R  R   t   last_pt   last_reprtbt
   last_linesRÎ   R   R)   RK   R*   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_traceback_short_no_sourceT  sR    			

    E   
    E   
    E   c         C   s†  | d ƒ } t  j j t | j ƒ } x[d d f D]M} t d | ƒ } | j | ƒ } | j } t | ƒ } d }	 | |	 k }
 |
 ryt	 j
 d f |
 f d f | |	 f ƒ i d t j ƒ  k pÈ t	 j t ƒ rÚ t	 j t ƒ n d d	 6d
 t j ƒ  k pÿ t	 j | ƒ rt	 j | ƒ n d
 d 6t	 j |	 ƒ d 6t	 j | ƒ d 6t	 j | ƒ d 6} d d i | d 6} t t	 j | ƒ ƒ ‚ n  t } } }
 }	 | j } | | k } | r}t	 j
 d f | f d f | | f ƒ i d
 t j ƒ  k pìt	 j | ƒ rþt	 j | ƒ n d
 d	 6t	 j | ƒ d 6d t j ƒ  k p3t	 j | ƒ rEt	 j | ƒ n d d 6} d d i | d 6} t t	 j | ƒ ƒ ‚ n  t } } | j } | } | rd d i d
 t j ƒ  k pÆt	 j | ƒ rØt	 j | ƒ n d
 d	 6t	 j | ƒ d 6} t t	 j | ƒ ƒ ‚ n  t } } | j | ƒ } | j } | r¡d d i d t j ƒ  k p\t	 j | ƒ rnt	 j | ƒ n d d	 6t	 j | ƒ d 6} t t	 j | ƒ ƒ ‚ n  t } | j } | j } t | ƒ }
 | j } t | ƒ } |
 | k } | rqt	 j
 d f | f d f |
 | f ƒ i	 d t j ƒ  k p2t	 j t ƒ rDt	 j t ƒ n d d 6d t j ƒ  k pit	 j t ƒ r{t	 j t ƒ n d d	 6d t j ƒ  k p t	 j | ƒ r²t	 j | ƒ n d d 6d
 t j ƒ  k p×t	 j | ƒ rét	 j | ƒ n d
 d 6t	 j | ƒ d 6t	 j | ƒ d 6t	 j | ƒ d 6t	 j |
 ƒ d 6t	 j | ƒ d 6} d d i | d  6} t t	 j | ƒ ƒ ‚ n  t } } }
 } } } | j } | j } | j } d! }	 | |	 ƒ } | rld d" i t	 j |	 ƒ d 6d t j ƒ  k p÷t	 j | ƒ r	t	 j | ƒ n d d	 6t	 j | ƒ d 6t	 j | ƒ d 6t	 j | ƒ d 6t	 j | ƒ d 6} t t	 j | ƒ ƒ ‚ n  t } } } }	 } | j } | j } d# }
 | |
 k } | rlt	 j
 d f | f d$ f | |
 f ƒ i d t j ƒ  k pòt	 j | ƒ rt	 j | ƒ n d d	 6t	 j | ƒ d 6t	 j | ƒ d 6t	 j |
 ƒ d 6} d d% i | d 6} t t	 j | ƒ ƒ ‚ n  t } } } }
 q1 Wd  S(&   Nsq   
            def f(x):
                raise ValueError(x)
            def entry():
                f(0)
        t   longR-  R,  i   s   ==sQ   %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.reprentries
})
} == %(py8)sRA   R   R  RC   RE   RD   Rl   R   s   assert %(py10)sRX   s-   %(py2)s
{%(py2)s = %(py0)s.style
} == %(py4)sR   R   s   assert %(py6)sR   s1   assert not %(py2)s
{%(py2)s = %(py0)s.extraline
}s1   assert %(py2)s
{%(py2)s = %(py0)s.reprtraceback
}R”   s¸   %(py7)s
{%(py7)s = %(py0)s(%(py5)s
{%(py5)s = %(py3)s
{%(py3)s = %(py1)s.reprtraceback
}.reprentries
})
} == %(py14)s
{%(py14)s = %(py9)s(%(py12)s
{%(py12)s = %(py10)s.reprentries
})
}Rj   Rm   Rn   Rp   s   assert %(py16)st   py16s   mod.pys…   assert %(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprcrash
}.path
}.endswith
}(%(py8)s)
}s   ValueError: 0sN   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprcrash
}.message
} == %(py7)ss   assert %(py9)s(   R   Rs   Rt   R   RO   R    R3  Rñ   RA   R    R!   R"   R#   R$   R%   R&   R'   R   R,  t	   extralineRï   Rð   R™   Rb   RV   t   message(   R	   Râ   R  R6   R,  Rq   R  RK   RM   R^   R{   RN   R`   R(   R)   R*   R+   R   R”   R9   Rˆ   R~   R|   R¾   t   @py_format17RL   R_   R  R‚   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_traceback_and_excinfoo  s€    		     É   	   ©   
	   U  
	  U  	 	  	    ÿ X   	 	 	    •  	 	    ’   c         C   sª  | d ƒ } t  j j t | j ƒ } t ƒ  } d „  } | j t  j j d | ƒ | j	 } | t
 ƒ } | t
 k }	 |	 s‰t j d |	 f d | t
 f ƒ i d t j ƒ  k s¸ t j | ƒ rÇ t j | ƒ n d d 6t j | ƒ d 6d	 t j ƒ  k sÿ t j t
 ƒ rt j t
 ƒ n d	 d
 6t j | ƒ d 6d	 t j ƒ  k sFt j t
 ƒ rUt j t
 ƒ n d	 d 6}
 d i |
 d 6} t t j | ƒ ƒ ‚ n  d  } } }	 | j | ƒ } d  S(   Nsq   
            def f(x):
                raise ValueError(x)
            def entry():
                f(0)
        c           S   s   t  d ƒ ‚ d  S(   Ni   (   t   OSError(    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   raiseosŽ  s    t   getcwds   ==sO   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s._makepath
}(%(py3)s)
} == %(py7)sRq   R   R   Rv   RD   Rl   Rn   R   s   assert %(py9)sRj   (   s   ==(   sO   %(py5)s
{%(py5)s = %(py2)s
{%(py2)s = %(py0)s._makepath
}(%(py3)s)
} == %(py7)ss   assert %(py9)s(   R   Rs   Rt   R   RO   R    R7  RÂ   t   ost	   _makepathRv   R    R!   R"   R#   R$   R%   R&   R'   R   R3  (   R	   Râ   Rš   R  R6   Rq   RD  R(   RM   R{   R  R‚   R  (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt$   test_repr_traceback_with_invalid_cwd„  s    				    ê   c         C   sœ  | d ƒ } t  j j t | j ƒ } | j ƒ  } | j d d ƒ t ƒ  } | j | ƒ | j	 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  } } } | j	 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  } } } d  S(   NsE   
            def entry():
                raise ValueError()
        t   titlet   contentiÿÿÿÿs   ==s   %(py1)s == %(py4)sRC   R   R   s   assert %(py6)sR   iþÿÿÿt   -(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   RK  s   title(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R   Rs   Rt   R   RO   R˜   t
   addsectionR   R%  R   R    R!   R%   R&   R'   R   (   R	   Râ   R  R6   R”   t   twmockR   R)   RK   R*   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_excinfo_addouterr”  s.    		    E       E   c         C   s<  | d ƒ } t  j j t | j ƒ } | j ƒ  } | j } | j } | j } d } | | ƒ }	 |	 sd d 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}
 t t	 j |
 ƒ ƒ ‚ n  d  } } } } }	 | j } | 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  } } } } | j } | 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  } } } } | j } t | ƒ } | j } d } | | ƒ } | s"d d i t	 j
 | ƒ d 6t	 j
 | ƒ d 6d 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 6t	 j
 | ƒ d 6} t t	 j | ƒ ƒ ‚ n  d  } } } } } d  S(!   NsE   
            def entry():
                raise ValueError()
        s   mod.pyR   s…   assert %(py10)s
{%(py10)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprcrash
}.path
}.endswith
}(%(py8)s)
}RE   R”   R   R   R   R   RX   i   s   ==sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprcrash
}.lineno
} == %(py7)sRn   s   assert %(py9)sRj   R   sN   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprcrash
}.message
} == %(py7)ss   mod.py:3: ValueErrors‰   assert %(py11)s
{%(py11)s = %(py7)s
{%(py7)s = %(py5)s
{%(py5)s = %(py0)s(%(py3)s
{%(py3)s = %(py1)s.reprcrash
})
}.endswith
}(%(py9)s)
}Rk   RS   RC   RD   Rl   (   s   ==(   sM   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprcrash
}.lineno
} == %(py7)ss   assert %(py9)s(   s   ==(   sN   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprcrash
}.message
} == %(py7)ss   assert %(py9)s(   R   Rs   Rt   R   RO   R˜   R™   Rb   RV   R    R%   R"   R#   R$   R&   R'   R   R5   R!   R@  RS   (   R	   Râ   R  R6   R”   R(   R)   RL   R^   R_   R`   R{   R  R‚   RK   RM   R|   R}   Rƒ   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_excinfo_reprcrash¡  sP    		 	 	    •  	 	    Œ   	 	    Œ   	  	    Ì  c         C   sç  | d ƒ } t  j j t | j ƒ } x¼d D]´} t d d ƒ } | j | ƒ } | 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  } }	 } t | ƒ } | sÙd d i d t
 j ƒ  k s`t j t ƒ rot j t ƒ n d d
 6d	 t
 j ƒ  k s—t j | ƒ r¦t j | ƒ n d	 d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } q+ Wd  S(   Ns¯   
            def rec2(x):
                return rec1(x+1)
            def rec1(x):
                return rec2(x-1)
            def entry():
                rec1(42)
        R-  R=  R/  R,  s/   !!! Recursion detected (same locals & position)s   ==s1   %(py2)s
{%(py2)s = %(py0)s.extraline
} == %(py5)sR  R   R   Rl   R   s   assert %(py7)sRn   s,   assert %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}RS   RC   RD   (   s   shorts   longs   no(   s   ==(   s1   %(py2)s
{%(py2)s = %(py0)s.extraline
} == %(py5)ss   assert %(py7)s(   R   Rs   Rt   R   RO   R    R3  R?  R    R!   R"   R#   R$   R%   R&   R'   R   RS   (   R	   Râ   R  R6   R,  Rq   R  R(   RM   R)   R   R  RK   R   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_repr_traceback_recursion­  s&    		    |     Œ  c         C   sñ   | d ƒ } t  j j t | j ƒ } t ƒ  } | j | j d | ƒ } | j } | 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  } }	 } d  S(   NsY   
            def somefunc():
                x = 1
                assert x == 2
        iÿÿÿÿs   E       assert 1 == 2s   ==s   %(py1)s == %(py4)sRC   R   R   s   assert %(py6)sR   (   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R   Rs   Rt   R&   t   somefuncR    R  R4   R   R    R!   R%   R'   R   (   R	   Râ   R  R6   Rq   R0  R   R   R)   RK   R*   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_tb_entry_AssertionError¾  s    			
    E   c         C   s…  | d ƒ } y | j  ƒ  Wn  t k
 r< t j j ƒ  } n XxAd D]9} x0t t f D]"} | j d | d | ƒ } t | t	 ƒ } | sed d 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 6d t
 j ƒ  k s#t j t	 ƒ r2t j t	 ƒ n d d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } | j }	 |	 j } | | k }
 |
 sk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 6d t
 j ƒ  k s(t j | ƒ r7t j | ƒ n d d 6} d i | d 6} t t j | ƒ ƒ ‚ n  d  }	 } }
 qW WqD Wd  S(   Nsq   
            def f(x):
                raise ValueError(x)
            def entry():
                f(0)
        R-  R=  R/  R,  R  R   s5   assert %(py4)s
{%(py4)s = %(py0)s(%(py1)s, %(py2)s)
}R×   R   R”   RC   R   R   R   s   ==sP   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprtraceback
}.style
} == %(py6)sR   s   assert %(py8)sRE   (   s   shorts   longs   no(   s   ==(   sP   %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.reprtraceback
}.style
} == %(py6)ss   assert %(py8)s(   RO   R   R   R   R   R;   R  R˜   R×   R   R"   R#   R    R$   R%   R&   R'   R   Rð   R,  R!   (   R	   Râ   R  R6   R,  R  R”   R)   R*   R(   RL   R+   RN   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_reprexcinfo_getreprÏ  s,    	  Ã  	 	   ³   c         C   s¤  d d l  m } d | f d „  ƒ  Y} t j j | ƒ  ƒ } 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 6d t j	 ƒ  k st j
 t ƒ rt j t ƒ 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(   Niÿÿÿÿ(   t   TerminalReprt   MyReprc           B   s   e  Z d  „  Z RS(   c         S   s    | j  t j j d d ƒ ƒ d  S(   Ns   Ñs   utf-8(   R   R   RŸ   t   _totext(   R	   R&  (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyR%  ä  s    (   R   R   R%  (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyRU  ã  s   s   Ñs   utf-8s   ==sv   %(py0)s == %(py12)s
{%(py12)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s.builtin
}._totext
}(%(py8)s, %(py10)s)
}RE   R8   R   R   R   R   R   Rp   RX   R   s   assert %(py14)sRm   (   s   ==(   sv   %(py0)s == %(py12)s
{%(py12)s = %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s.builtin
}._totext
}(%(py8)s, %(py10)s)
}s   assert %(py14)s(   R6  RT  R   RŸ   RV  R    R!   R%   R"   R#   R$   R&   R'   R   (   R	   RT  RU  R8   R)   RL   R^   R_   Rˆ   R(   R®   R¾   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_reprexcinfo_unicodeá  s    	 	      ã   c         C   s  | d ƒ } t  j j t | j ƒ } | j j ƒ  | _ | j ƒ  } t ƒ  } | j	 | ƒ | j
 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  } } } | j
 j d ƒ | j
 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  } } } | j
 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  } } } | j
 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  } } } | j
 d } | j } d } | | ƒ } | s€d d i t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } } } | j
 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  } } } | j
 d } d } | | k } | sÆt j d0 | f d1 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}	 d2 i |	 d	 6}
 t t j |
 ƒ ƒ ‚ n  d  } } } | j
 d } d } | | k } | sgt j d3 | f d4 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}	 d5 i |	 d	 6}
 t t j |
 ƒ ƒ ‚ n  d  } } } | j
 d } d } | | k } | st j d6 | f d7 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}	 d8 i |	 d	 6}
 t t j |
 ƒ ƒ ‚ n  d  } } } | j
 d } d } | | k } | s©t j d9 | f d: | | f ƒ i t j | ƒ d 6t j | ƒ d 6}	 d; i |	 d	 6}
 t t j |
 ƒ ƒ ‚ n  d  } } } | j
 d } d } | | k } | sJt j d< | f d= | | f ƒ i t j | ƒ d 6t j | ƒ d 6}	 d> i |	 d	 6}
 t t j |
 ƒ ƒ ‚ n  d  } } } | j
 d } | j } d } | | ƒ } | sìd d i t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } } } } d  S(?   Nsm   
            def g(x):
                raise ValueError(x)
            def f():
                g(3)
        i    R   s   ==s   %(py1)s == %(py4)sRC   R   s   assert %(py6)sR   s       def f():i   s   >       g(3)i   i   s
   mod.py:5: sJ   assert %(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.endswith
}(%(py5)s)
}RD   Rl   Rn   i   s   _ i   i   s       def g(x):i   s   >       raise ValueError(x)i   s   E       ValueError: 3i	   i
   s   mod.py:3: ValueError(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   _ N(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R   Rs   Rt   R   R.   R4   R‡   R˜   R   R%  R   R    R!   R%   R&   R'   R   t   popRV   (   R	   Râ   R  R6   R”   R&  R   R)   RK   R*   R+   RM   R{   R  (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_toterminal_longé  sÐ    		    E       E       E       E    	    N      E       E       E       E       E       E    	    N  c         C   sÓ  | d ƒ } t  j j t | j ƒ } | j d ƒ j ƒ  | j j ƒ  | _ | j	 ƒ  } t
 ƒ  } | j | ƒ | j 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  } }	 } | j j d ƒ | j 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  } }	 } | j d } d } | | k }	 |	 sPt j d" |	 f d# | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d$ i |
 d
 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } | j }	 d } |	 | ƒ } | sòd d i t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } }	 } } | j 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  } }	 } | j d } d } | | k }	 |	 s8t j d) |	 f d* | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d+ i |
 d
 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j 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  } }	 } | j d } d } | | k }	 |	 szt j d/ |	 f d0 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d1 i |
 d
 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } d } | | k }	 |	 st j d2 |	 f d3 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d4 i |
 d
 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } | j }	 d } |	 | ƒ } | s½d d i t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } }	 } } d  S(5   Nsm   
            def g(x):
                raise ValueError(x)
            def f():
                g(3)
        s   mod.pyi    R   s   ==s   %(py1)s == %(py4)sRC   R   s   assert %(py6)sR   s   >   ???i   i   s
   mod.py:5: sJ   assert %(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.endswith
}(%(py5)s)
}RD   Rl   Rn   i   s   _ i   i   i   s   E   ValueError: 3i   i   s   mod.py:3: ValueError(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   _ N(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R   Rs   Rt   R   R.   RÈ   RH   R4   R‡   R˜   R   R%  R   R    R!   R%   R&   R'   R   RX  RV   (   R	   Râ   RÏ   R  R6   R”   R&  R   R)   RK   R*   R+   RM   R{   R  (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt#   test_toterminal_long_missing_source  s²    		    E       E       E    	    N      E       E       E       E       E    	    N  c         C   sÖ  | d ƒ } t  j j t | j ƒ } | j d ƒ j d ƒ | j j ƒ  | _ | j	 ƒ  } t
 ƒ  } | j | ƒ | j 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  } }	 } | j j d ƒ | j 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  } }	 } | j d } d } | | k }	 |	 sSt j d# |	 f d$ | | f ƒ i t j | ƒ d 6t j | ƒ d	 6}
 d% i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } | j }	 d } |	 | ƒ } | sõd d i t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } }	 } } | j 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  } }	 } | j 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  } }	 } | j 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  } }	 } | j d } d } | | k }	 |	 s}t j d0 |	 f d1 | | f ƒ i t j | ƒ d 6t j | ƒ d	 6}
 d2 i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } d } | | k }	 |	 st j d3 |	 f d4 | | f ƒ i t j | ƒ d 6t j | ƒ d	 6}
 d5 i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } | j }	 d } |	 | ƒ } | sÀd d i t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } }	 } } d  S(6   Nsm   
            def g(x):
                raise ValueError(x)
            def f():
                g(3)
        s   mod.pyt   asdfi    R   s   ==s   %(py1)s == %(py4)sRC   R   s   assert %(py6)sR   s   >   ???i   i   s
   mod.py:5: sJ   assert %(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.endswith
}(%(py5)s)
}RD   Rl   Rn   i   s   _ i   i   i   s   E   ValueError: 3i   i   s   mod.py:3: ValueError(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   _ N(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R   Rs   Rt   R   R.   RÈ   RÉ   R4   R‡   R˜   R   R%  R   R    R!   R%   R&   R'   R   RX  RV   (   R	   Râ   RÏ   R  R6   R”   R&  R   R)   RK   R*   R+   RM   R{   R  (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt&   test_toterminal_long_incomplete_source  s²    		    E       E       E    	    N      E       E       E       E       E    	    N  c         C   s”  | d ƒ } t  j j t | j ƒ } t ƒ  } t  j j | j ƒ } | j	 ƒ  j
 ƒ  } z.| j d t ƒ } | j | ƒ | j d } t  j j ƒ  j | ƒ }	 t |	 ƒ t t | ƒ ƒ k  rsd }
 | |
 k } | sf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  } }
 n  | j d t ƒ } | j | ƒ | j d } d }
 | f } |
 | } | | k } | so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  } }
 } } Wd  | j
 ƒ  Xd  S(   NsA   
            def f():
                raise ValueError()
        t   abspathiÿÿÿÿs   mod.py:3: ValueErrors   ==s   %(py0)s == %(py3)sR   R   RD   R   s   assert %(py5)sRl   s   %s:3: ValueErrors   %(py0)s == (%(py3)s %% %(py5)s)s   assert %(py8)sRE   (   s   ==(   s   %(py0)s == %(py3)ss   assert %(py5)s(   s   ==(   s   %(py0)s == (%(py3)s %% %(py5)s)s   assert %(py8)s(   R   Rs   Rt   R   R.   R   Rb   Ru   Rv   Rw   t   chdirR˜   R  R%  R   t   bestrelpathRA   RS   R    R!   R"   R#   R$   R%   R&   R'   R   R;   (   R	   Râ   R  R6   R&  Rb   t   oldR”   R   R8   RK   R(   R   R   RM   R{   R+   RN   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_toterminal_long_filenames5  s@    		   l    	 
   |   t   reproptionsR=  R-  R/  R,  R  R  R2  c         C   s  | d ƒ } t  j j t | j ƒ } t  j j d t ƒ } | j |   } | j	 | ƒ | j
 } | j } | ƒ  }	 |	 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  S(
   Nsm   
            def g(x):
                raise ValueError(x)
            def f():
                g(3)
        t   stringioR   sa   assert %(py6)s
{%(py6)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.stringio
}.getvalue
}()
}R&  R   R   R   R   (   R   Rs   Rt   R   R.   t   iot   TerminalWriterR;   R˜   R%  Rc  t   getvalueR"   R#   R    R$   R%   R&   R'   R   (   R	   Râ   Rb  R  R6   R&  R”   R(   R)   RL   R+   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_format_excinfoM  s    		 	 	  u  c         C   s±  |  j  d ƒ } | j d d ƒ } d } | j } t | ƒ } | | k } | s:t j d# | f d$ | | f ƒ i t j | ƒ d 6t j | ƒ d 6d	 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 6} d% i | d 6} t
 t j | ƒ ƒ ‚ n  d  } } } } 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  }
 } } |	 j }
 d } |
 | ƒ } | sÂd d i d t j ƒ  k s`t j	 |	 ƒ ro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 s:t j	 |	 ƒ rIt j |	 ƒ n d d
 6} d( i | d 6} t
 t j | ƒ ƒ ‚ n  d  } } t j j j d) k r­|	 j }
 d } |
 | ƒ } 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 6t j | ƒ d 6} d, i | d" 6} t
 t j | ƒ ƒ ‚ n  d  }
 } } } } n  d  S(-   Ns   
            assert 0
        R,  t   natives   assert 0R“   sO   %(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.reprcrash
})
}RE   RC   RS   RD   R”   R   R   R   s   assert %(py10)sRX   s)   Traceback (most recent call last):
  FilesL   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.startswith
}(%(py4)s)
}RR   R   R   s   
AssertionError: assert 0sJ   assert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.endswith
}(%(py4)s)
}s   exec (source.compile())s   %(py1)s in %(py3)ss   assert %(py5)sRl   i   i   s   ==sK   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.count
}(%(py4)s)
} == %(py9)sRj   s   assert %(py11)sRk   (   R“   (   sO   %(py1)s in %(py8)s
{%(py8)s = %(py3)s(%(py6)s
{%(py6)s = %(py4)s.reprcrash
})
}s   assert %(py10)s(   R“   (   s   %(py1)s in %(py3)ss   assert %(py5)s(   i   i   (   s   ==(   sK   %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.count
}(%(py4)s)
} == %(py9)ss   assert %(py11)s(   Ræ   R˜   R™   RS   R    R!   R%   R"   R#   R$   R&   R'   R   RU   RV   R   RÂ   R   RÃ   t   count(   R	   R6   R”   R   RL   R^   RK   RN   R`   RR   R(   R)   R+   R   R   R|   R‚   Rƒ   (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_native_styleb  sZ    	 	    Ã   	    u  	    u     l   
	      œ   c         C   sh  | d ƒ } t  j j t | j ƒ } | j j ƒ  | _ | j d j d ƒ | j d j d ƒ | j d d ƒ } t	 ƒ  } | j
 | ƒ x | j D] } | GHq W| j d } d } | | k }	 |	 s2t j d- |	 f d. | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d/ i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } d } | | k }	 |	 sÓt j d0 |	 f d1 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d2 i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } d } | | k }	 |	 stt j d3 |	 f d4 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d5 i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } d } | | k }	 |	 st j d6 |	 f d7 | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 d8 i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d } | j }	 d } |	 | ƒ } | s·d d i t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } }	 } } | j d } d9 } | | 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  } }	 } | j d } | j }	 d } |	 | ƒ } | sþd d i t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } }	 } } | j 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  } }	 } | j d } | j }	 d } |	 | ƒ } | sEd d i t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } }	 } } | j d  } d! } | | k }	 |	 sêt j d@ |	 f dA | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 dB i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d" } dC } | | k }	 |	 s‹t j dD |	 f dE | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 dF i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d# } d } | | k }	 |	 s,t j dG |	 f dH | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 dI i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d$ } d% } | | k }	 |	 sÍt j dJ |	 f dK | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 dL i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d& } d' } | | k }	 |	 sn	t j dM |	 f dN | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 dO i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d( } d) } | | k }	 |	 s
t j dP |	 f dQ | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 dR i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d* } d } | | k }	 |	 s°
t j dS |	 f dT | | f ƒ i t j | ƒ d 6t j | ƒ d 6}
 dU i |
 d 6} t t j | ƒ ƒ ‚ n  d  } }	 } | j d+ } | j }	 d, } |	 | ƒ } | sRd d i t j | ƒ d 6t j |	 ƒ d 6t j | ƒ d 6t j | ƒ d 6} t t j | ƒ ƒ ‚ n  d  } }	 } } d  S(V   Ns¼   
            def f():
                g()
            def g():
                h()
            def h():
                i()
            def i():
                raise ValueError()
        i   R-  i   R,  R=  i    R   s   ==s   %(py1)s == %(py4)sRC   R   s   assert %(py6)sR   s       def f():s   >       g()i   i   s
   mod.py:3: sJ   assert %(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.endswith
}(%(py5)s)
}RD   Rl   Rn   i   s   _ i   s   in gi   s       h()i   s   in hi	   s       i()i
   i   i   s       def i():i   s   >       raise ValueError()i   s   E       ValueErrori   i   s   mod.py:9: ValueError(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   _ N(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   _ N(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   s   ==(   s   %(py1)s == %(py4)ss   assert %(py6)s(   R   Rs   Rt   R   R.   R4   R‡   t   set_repr_styleR˜   R   R%  R   R    R!   R%   R&   R'   R   RV   (   R	   Râ   R  R6   t   rR&  R   R   R)   RK   R*   R+   RM   R{   R  (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   test_traceback_repr_stylep  s&   			 	    E       E       E       E    	    N      E    	    N      E    	    N      E       E       E       E       E       E       E    	    N  (   s   longs   shorts   no()   R   R   Rã   Ræ   Rë   Rí   Rò   Ró   R  R  R  R+  R.  R1  R4  R<  RB  RH  RN  RO  RP  RR  RS  RW  RY  RZ  R\  Ra  R   Rs   t   markt   multiR,  R;   R  R  R2  R  Rg  Rj  Rm  (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyRÛ   C  sF   		
			
		6	
																			
M	(    (    (    (1   t   __builtin__R"   t   _pytest.assertion.rewritet	   assertiont   rewriteR    R   R6  R    R   RŸ   t
   _tryimportR   Rs   Rn  t   xfailR±   t   test_sourceR   t	   importlibt   ImportErrorR   RÞ   t   getattrR•   t   tuplet   mapt   intt   __version__R½   t   pytest_version_infoR   R,   R:   R.   R-   R=   R>   R’   R¶   Rº   R»   R¿   RÁ   RÄ   RÒ   RÖ   RÚ   RÛ   (    (    (    s?   /home/ronny/Projects/pytest-dev/py/testing/code/test_excinfo.pyt   <module>   s>     
%					£												