ó
'![c           @   sØ  d  Z  d d l Z d d l Z d d l m Z m Z m Z d d l Z d d l Z d d l	 j
 Z
 d d l m Z e e e e ƒ ƒ d ƒ Z e j j d e ƒ y e j Z Wn e k
 rÅ d Z n Xe j d d ƒ d	 „  ƒ Z e j d d ƒ d
 „  ƒ Z e j d „  ƒ Z d „  Z e j j d d e d ƒ f d e d ƒ f d e d ƒ f d d „  f e e d ƒ e d ƒ f e e d ƒ e d ƒ f e e d ƒ e d ƒ f e e d d ƒ e d ƒ f e e d ƒ d „  f g	 ƒ d „  ƒ Z e j j d e e d ƒ e e d ƒ e e d ƒ g ƒ d  „  ƒ Z e j j d! g  e j e ƒ D] Z e j  d" ƒ rDe ^ qDƒ d# „  ƒ Z! e j d$ „  ƒ Z" e j j# d% ƒ d& „  ƒ Z$ e j j% e o¶e d- k  d) d* ƒd+ „  ƒ Z& d, „  Z' d S(.   s‹   non regression tests for pylint, which requires a too specific configuration
to be incorporated in the automatic functional test framework
iÿÿÿÿN(   t   abspatht   dirnamet   join(   t   epylintt   regrtest_datai   t   scopet   modulec         C   s   t  j S(   N(   t	   testutilst   TestReporter(   t   reporter(    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyR	   $   s    c         C   s   d g S(   Nt   I(    (   t   disable(    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyR   )   s    c         c   s   |  V|  j  j ƒ  d S(   sV   call reporter.finalize() to cleanup
    pending messages if a test finished badly
    N(   R	   t   finalize(   t   linter(    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt   finalize_linter.   s    c            s   ‡  f d †  S(   Nc            s
   |  ˆ  k S(   N(    (   t   got(   t   expected(    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt   <lambda>8   s    (    (   R   (    (   R   s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt   Equals7   s    s   file_name, checks   package.__init__t    t   precedence_testt    import_package_subpackage_modules   pylint.checkers.__init__c         C   s
   d |  k S(   Nt   __path__(    (   t   x(    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyR   ?   s    s   classdoc_usage.pys   module_global.pys   decimal_inference.pyt   absimps	   string.pyt   bad_packagec         C   s
   d |  k S(   Ns   Unused import missing(    (   R   (    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyR   E   s    c         C   s8   |  j  | ƒ |  j j ƒ  j ƒ  } | | ƒ s4 t ‚ d  S(   N(   t   checkR	   R   t   stript   AssertionError(   R   t	   file_nameR   R   (    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt   test_package;   s    R   s   import_assign.pys"   special_attr_scope_lookup_crash.pyt   try_finally_disable_msg_crashc         C   s   |  j  | ƒ d  S(   N(   R   (   R   R   (    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt
   test_crashN   s    t   fnames	   _crash.pyc         C   s-   | j  t t |  ƒ ƒ | j j ƒ  j ƒ  d  S(   N(   R   R   t	   REGR_DATAR	   R   R   (   R!   R   (    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt   test_descriptor_crashW   s    c          c   sE   t  j ƒ  }  t j j d d ƒ d  Vt j j d ƒ t  j |  ƒ d  S(   Ni    R   (   t   ost   getcwdt   syst   patht   insertt   popt   chdir(   t   cwd(    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt   modify_path^   s
    R,   c         C   s–   d } |  j  | ƒ t |  j d j ƒ  ƒ } | | g k sA t ‚ t j t t d ƒ ƒ |  j  d ƒ t |  j d j ƒ  ƒ } | d g k s’ t ‚ d  S(   Ns   package.__init__t	   by_modulet   packaget   __init__(	   R   t   listt   statst   keysR   R$   R*   R   R"   (   R   t   filenamet   checked(    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt   test_check_package___init__g   s    i   i    t   reasons°   On older PyPy versions, sys.executable was set to a value that is not supported by the implementation of this function. ( https://bitbucket.org/pypy/pypy/commits/19e305e27e67 )c          C   s|   t  t d ƒ }  t j |  d t ƒ\ } } t | d ƒ s? t ‚ t | d ƒ sT t ‚ | j d ƒ } t | t	 ƒ sx t ‚ d  S(   Ns   huge.pyt
   return_stdt   readi
   (
   R   R"   R   t   py_runt   Truet   hasattrR   R8   t
   isinstancet   str(   R'   t   outt   errt   output(    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt)   test_epylint_does_not_block_on_huge_filest   s    c          C   sû   t  j j d ƒ }  |  d } d d d d d d d	 g } g  | j ƒ  D] } | j ^ qD | k se t ‚ t t  j | ƒ j d
 ƒ ƒ s‰ t ‚ t t  j | ƒ j	 d
 ƒ ƒ } t
 | ƒ d k s¿ t ‚ | d j ƒ  j d k sÞ t ‚ | d j d k s÷ t ‚ d  S(   Ns   pylint.lintt   PyLintert   OptionsManagerMixInt   objectt   MessagesHandlerMixInt   ReportsHandlerMixInt   BaseTokenCheckert   BaseCheckert   OptionsProviderMixInt   configi   i    t   optparset   Values(   t   astroidt   MANAGERt   ast_from_module_namet	   ancestorst   nameR   R0   t   Instancet   getattrt   igetattrt   lent   root(   t   modt   pylintert   expectt   ct   inferred(    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt   test_pylint_config_attr   s    
			.$(   i   i    ((   t   __doc__R&   R$   t   os.pathR    R   R   t   pytestRM   t   pylint.testutilsR   t   pylintR   t   __file__R"   R'   R(   t   pypy_version_infot   PYPY_VERSION_INFOt   AttributeErrort   Nonet   fixtureR	   R   R   R   t   markt   parametrizeR   R    t   listdirR   t   endswithR#   R,   t
   usefixtureR5   t   skipifRA   R\   (    (    (    s4   lib/python2.7/site-packages/pylint/test/test_regr.pyt   <module>   sN   
			"'	