ó
|‰ãW¿  c           @   s|   d  d l  Z d  d l j j Z d  d l Z d  d l Z d  d l Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d S(   iÿÿÿÿNc   
      C   sf  t  t |  ƒ } t | d ƒ rb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  } } } | j GHxt | j ƒ D]}  t | |  ƒ } | sUt j | |  f ƒ 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	 |  ƒ r"t j
 |  ƒ n d d 6t j
 | ƒ d 6}	 t t j |	 ƒ ƒ ‚ n  d  } qPWn  d  S(   Nt   __map__i    t   >s/   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} > %(py6)st   lent   py0t   keyst   py1t   py3t   py6t    s   assert %(py8)st   py8s7   
>assert %(py4)s
{%(py4)s = %(py0)s(%(py1)s, %(py2)s)
}t   hasattrt   objt   namet   py2t   py4(   R   (   s/   %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
} > %(py6)ss   assert %(py8)s(   t   getattrt   pyR
   t   dirR   t
   @pytest_art   _call_reprcomparet   @py_builtinst   localst   _should_repr_global_namet	   _safereprt   AssertionErrort   _format_explanationt   NoneR    t   listt   _format_assertmsg(
   R   R   R   t   @py_assert2t   @py_assert5t   @py_assert4t   @py_format7t   @py_format9t   @py_assert3t   @py_format5(    (    sB   /home/ronny/Projects/pytest-dev/py/testing/root/test_py_imports.pyt   checksubpackage   s$        ³     Ò  c          c   s8   x1 t  t ƒ D]# }  |  j d ƒ s t |  f Vq q Wd  S(   Nt   _(   R   R   t
   startswithR$   (   R   (    (    sB   /home/ronny/Projects/pytest-dev/py/testing/root/test_py_imports.pyt   test_dir   s    c          C   sì  d d l  m }  d d l  m } |  | k } | sî t j d | f d |  | f ƒ i d t j ƒ  k st t j |  ƒ rƒ t j |  ƒ n d d 6d t j ƒ  k s« t j | ƒ rº t j | ƒ n d d 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } d d l m } d d l m } | | k } | sât j d | f d | | f ƒ i d t j ƒ  k sht j | ƒ rwt j | ƒ n d d 6d t j ƒ  k sŸt j | ƒ r®t j | ƒ n d d 6} d i | d 6} t t j	 | ƒ ƒ ‚ n  d  } d  S(   Niÿÿÿÿ(   t   patht   iss   %(py0)s is %(py2)st   path1R   t   path2R   R   s   assert %(py4)sR   (   t   localt   local1t   local2(   R)   (   s   %(py0)s is %(py2)ss   assert %(py4)s(   R)   (   s   %(py0)s is %(py2)ss   assert %(py4)s(   R   R(   R   R   R   R   R   R   R   R   R   t   py.pathR,   (   R*   R+   t   @py_assert1t   @py_format3R#   R-   R.   (    (    sB   /home/ronny/Projects/pytest-dev/py/testing/root/test_py_imports.pyt   test_virtual_module_identity   s       “     “   c          C   s9  t  j }  g  } t j d k r: | j |  j d d ƒ ƒ n | j |  j d d ƒ ƒ d „  } xÖ |  j d | ƒ D]Â } | j d k rŠ qo n  | j d	 d
 ƒ j	 |  ƒ } |  j
 | k ro xz | D]% } | | k sÜ | j	 | ƒ r» Pq» q» W| j |  j
 d ƒ } d | } y t | ƒ Wq1t  j j j k
 r-q1Xqo qo Wd  S(   Ni   i    t   _codes   _assertionold.pys   _assertionnew.pyc         S   s   |  j  d d ƒ o |  j d k S(   Nt   dotfilei    t   attic(   t   checkt   basename(   t   p(    (    sB   /home/ronny/Projects/pytest-dev/py/testing/root/test_py_imports.pyt   recurse$   s    s   *.pys   __init__.pyt   extR   t   .s   py.%s(   i   i    (   R   t   _pydirt   syst   version_infot   appendt   joint   visitR7   t   newt   reltot   sept   replacet   check_importt   testt   skipt	   Exception(   t   baset   nodirsR9   R8   t   relpatht   xt   modpath(    (    sB   /home/ronny/Projects/pytest-dev/py/testing/root/test_py_imports.pyt   test_importall   s(    		
c         C   sÓ   t  j j d |  ƒ t |  ƒ } | sÉ d d i d t j ƒ  k sP 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} t	 t j
 | ƒ ƒ ‚ n  d  } d  S(	   Ns   checking importR   s,   assert %(py3)s
{%(py3)s = %(py0)s(%(py1)s)
}t
   __import__R   RN   R   R   (   R   t   builtint   print_RP   R   R   R   R   R   R   R   R   (   RN   R   t   @py_format4(    (    sB   /home/ronny/Projects/pytest-dev/py/testing/root/test_py_imports.pyRF   7   s      Œ  c          C   s£   t  j j t  g ƒ }  d  } x t |  ƒ | k rž t |  ƒ } x\ t  j j |  ƒ D]H } x? | j j ƒ  D]. } t | t	 t  j
 ƒ ƒ re |  j | ƒ qe qe WqO Wq Wd  S(   N(   R   RQ   t   setR   R   t	   frozensett   __dict__t   valuest
   isinstancet   typeRG   t   add(   t   seent
   lastlengtht   itemt   value(    (    sB   /home/ronny/Projects/pytest-dev/py/testing/root/test_py_imports.pyt   test_all_resolves;   s    (   t   __builtin__R   t   _pytest.assertion.rewritet	   assertiont   rewriteR   R   t   typesR=   R$   R'   R2   RO   RF   R_   (    (    (    sB   /home/ronny/Projects/pytest-dev/py/testing/root/test_py_imports.pyt   <module>   s     						