ó
'![c           @` sŒ   d  Z  d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l m	 Z	 m
 Z
 m Z d d l m Z d e	 f d „  ƒ  YZ d S(   s   Unit tests for the pylint checkers in :mod:`pylint.extensions.check_docs`,
in particular the parameter documentation checker `DocstringChecker`
i    (   t   divisiont   print_functiont   absolute_importN(   t   CheckerTestCaset   Messaget
   set_config(   t   DocstringParameterCheckert   TestParamDocCheckerc           B` sq  e  Z d  Z e Z i e d 6Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z e d e ƒ 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+ e, j- d" d# k d$ d% ƒd& „  ƒ Z. d' „  Z/ d( „  Z0 d) „  Z1 d* „  Z2 d+ „  Z3 d, „  Z4 d- „  Z5 d. „  Z6 d/ „  Z7 d0 „  Z8 d1 „  Z9 d2 „  Z: d3 „  Z; d4 „  Z< d5 d6 d7 d8 g Z= e= d9 d: d; d< d= d> g Z> e) j* j? d? e> ƒ d@ „  ƒ Z@ e) j* j? d? e> ƒ dA „  ƒ ZA e) j* j? d? e> ƒ dB „  ƒ ZB e) j* j? dC e= ƒ dD „  ƒ ZC dE „  ZD dF „  ZE dG „  ZF dH „  ZG dI „  ZH dJ „  ZI dK „  ZG dL „  ZH dM „  ZJ dN „  ZK dO „  ZL dP „  ZM dQ „  ZN dR „  ZO dS „  ZP dT „  ZQ dU „  ZR dV „  ZS dW „  ZT dX „  ZU dY „  ZV dZ „  ZT d[ „  ZU RS(\   s'   Tests for pylint_plugin.ParamDocCheckert   accept_no_param_docc      	   C` sf   t  j d ƒ } |  j t d d d | d d
 ƒ t d d d | d d ƒ ƒ  |  j j | ƒ Wd	 QXd	 S(   sc   Example of a function with missing Sphinx parameter documentation in
        the docstring
        s¤   
        def function_foo(x, y, z):
            '''docstring ...

            :param x: bla

            :param int z: bar
            '''
            pass
        t   msg_ids   missing-param-doct   nodet   argst   ys   missing-type-docs   x, yN(   R   (   s   x, y(   t   astroidt   extract_nodet   assertAddsMessagesR   t   checkert   visit_functiondef(   t   selfR
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt,   test_missing_func_params_in_sphinx_docstring$   s    		c      	   C` sf   t  j d ƒ } |  j t d d d | d d
 ƒ t d d d | d d ƒ ƒ  |  j j | ƒ Wd	 QXd	 S(   si   Example of a function with missing Google style parameter
        documentation in the docstring
        sÏ   
        def function_foo(x, y, z):
            '''docstring ...

            Args:
                x: bla
                z (int): bar

            some other stuff
            '''
            pass
        R	   s   missing-param-docR
   R   R   s   missing-type-docs   x, yN(   R   (   s   x, y(   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt,   test_missing_func_params_in_google_docstring>   s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   su   Example of a function with Google style parameter splitted
        in Args and Keyword Args in the docstring
        sV  
        def my_func(this, other, that=True):
            '''Prints this, other and that

                Args:
                    this (str): Printed first
                    other (int): Other args

                Keyword Args:
                    that (bool): Printed second
            '''
            print(this, that, other)
        N(   R   R   t   assertNoMessagesR   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt7   test_func_params_and_keyword_params_in_google_docstringZ   s    	c         C` s–   t  j d ƒ } |  j t d d d | d d ƒ t d d d | d d ƒ t d d d | d d ƒ t d d
 d | d d ƒ ƒ  |  j j | ƒ Wd QXd S(   s‘   Example of a function with Google style parameter splitted
        in Args and Keyword Args in the docstring but with wrong keyword args
        sW  
        def my_func(this, other, that=True):
            '''Prints this, other and that

                Args:
                    this (str): Printed first
                    other (int): Other args

                Keyword Args:
                    these (bool): Printed second
            '''
            print(this, that, other)
        R	   s   missing-param-docR
   R   t   thats   missing-type-docs   differing-param-doct   theses   differing-type-docN(   R   (   R   (   R   (   R   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt=   test_func_params_and_wrong_keyword_params_in_google_docstringn   s(    	c      	   C` sf   t  j d ƒ } |  j t d d d | d d
 ƒ t d d d | d d ƒ ƒ  |  j j | ƒ Wd	 QXd	 S(   sh   Example of a function with missing NumPy style parameter
        documentation in the docstring
        s  
        def function_foo(x, y, z):
            '''docstring ...

            Parameters
            ----------
            x:
                bla
            z: int
                bar

            some other stuff
            '''
            pass
        R	   s   missing-param-docR
   R   R   s   missing-type-docs   x, yN(   R   (   s   x, y(   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt+   test_missing_func_params_in_numpy_docstring“   s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sk   Example of a function with no parameter documentation at all

        No error message is emitted.
        s‡   
        def function_foo(x, y):
            '''docstring ...

            missing parameter documentation'''
            pass
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt+   test_tolerate_no_param_documentation_at_all²   s    	c      	   C` sf   t  j d ƒ } |  j t d d d | d d	 ƒ t d d d | d d
 ƒ ƒ  |  j j | ƒ Wd QXd S(   s~   Example of a function with no parameter documentation at all

        Missing documentation error message is emitted.
        s‡   
        def function_foo(x, y):
            '''docstring ...

            missing parameter documentation'''
            pass
        R	   s   missing-param-docR
   R   s   x, ys   missing-type-docN(   s   x, y(   s   x, y(   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt1   test_don_t_tolerate_no_param_documentation_at_allÂ   s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sg   Example for the usage of "For the parameters, see"
        to suppress missing-param warnings.
        s™   
        def function_foo(x, y):
            '''docstring ...

            For the parameters, see :func:`blah`
            '''
            pass
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt/   test_see_tolerate_no_param_documentation_at_allÚ   s    	c         C` sL   xE | j  D]: } t | t j ƒ r
 t | d ƒ r
 |  j j | ƒ q
 q
 Wd S(   sƒ   Visit all methods of a class node

        :param node: class node
        :type node: :class:`astroid.scoped_nodes.Class`
        t   nameN(   t   bodyt
   isinstanceR   t   FunctionDeft   hasattrR   R   (   R   R
   t	   body_item(    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt   _visit_methods_of_classé   s    c      	   C` sp   t  j d ƒ } | j d } |  j t d d d | d d ƒ t d d d | d d ƒ ƒ  |  j | ƒ Wd
 QXd
 S(   sm   Example of a class method with missing parameter documentation in
        the Sphinx style docstring
        sæ   
        class Foo(object):
            def method_foo(self, x, y):
                '''docstring ...

                missing parameter documentation

                :param x: bla
                '''
                pass
        i    R	   s   missing-param-docR
   R   R   s   missing-type-docs   x, yN(   R   (   s   x, y(   R   R   R   R   R   R$   (   R   R
   t   method_node(    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt.   test_missing_method_params_in_sphinx_docstringô   s    
	c      	   C` sp   t  j d ƒ } | j d } |  j t d d d | d d ƒ t d d d | d d ƒ ƒ  |  j | ƒ Wd
 QXd
 S(   sm   Example of a class method with missing parameter documentation in
        the Google style docstring
        sù   
        class Foo(object):
            def method_foo(self, x, y):
                '''docstring ...

                missing parameter documentation

                Args:
                    x: bla
                '''
                pass
        i    R	   s   missing-param-docR
   R   R   s   missing-type-docs   x, yN(   R   (   s   x, y(   R   R   R   R   R   R$   (   R   R
   R%   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt.   test_missing_method_params_in_google_docstring  s    	c      	   C` sp   t  j d ƒ } | j d } |  j t d d d | d d ƒ t d d d | d d ƒ ƒ  |  j | ƒ Wd
 QXd
 S(   sl   Example of a class method with missing parameter documentation in
        the Numpy style docstring
        s)  
        class Foo(object):
            def method_foo(self, x, y):
                '''docstring ...

                missing parameter documentation

                Parameters
                ----------
                x:
                    bla
                '''
                pass
        i    R	   s   missing-param-docR
   R   R   s   missing-type-docs   x, yN(   R   (   s   x, y(   R   R   R   R   R   R$   (   R   R
   R%   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt-   test_missing_method_params_in_numpy_docstring-  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sl   Example of a function with correctly documented parameters and
        return values (Sphinx style)
        sª  
        def function_foo(xarg, yarg, zarg, warg):
            '''function foo ...

            :param xarg: bla xarg
            :type xarg: int

            :parameter yarg: bla yarg
            :type yarg: my.qualified.type

            :arg int zarg: bla zarg

            :keyword my.qualified.type warg: bla warg

            :return: sum
            :rtype: float
            '''
            return xarg + yarg
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt-   test_existing_func_params_in_sphinx_docstringL  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sl   Example of a function with correctly documented parameters and
        return values (Google style)
        s—  
        def function_foo(xarg, yarg, zarg, warg):
            '''function foo ...

            Args:
                xarg (int): bla xarg
                yarg (my.qualified.type): bla
                    bla yarg

                zarg (int): bla zarg
                warg (my.qualified.type): bla warg

            Returns:
                float: sum
            '''
            return xarg + yarg
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt-   test_existing_func_params_in_google_docstringf  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sk   Example of a function with correctly documented parameters and
        return values (Numpy style)
        sá  
        def function_foo(xarg, yarg, zarg, warg):
            '''function foo ...

            Parameters
            ----------
            xarg: int
                bla xarg
            yarg: my.qualified.type
                bla yarg

            zarg: int
                bla zarg
            warg: my.qualified.type
                bla warg

            Returns
            -------
            float
                sum
            '''
            return xarg + yarg
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt,   test_existing_func_params_in_numpy_docstring~  s    	c         C` sø   t  j d ƒ } |  j t d d d | d d ƒ t d d d | d d ƒ t d d	 d | d d ƒ t d d d | d d ƒ ƒ  |  j j | ƒ Wd QXt  j d ƒ } |  j t d d	 d | d d ƒ t d d d | d d ƒ ƒ  |  j j | ƒ Wd QXd S(   s~   Example of functions with inconsistent parameter names in the
        signature and in the Sphinx style documentation
        s.  
        def function_foo(xarg, yarg, zarg):
            '''function foo ...

            :param xarg1: bla xarg
            :type xarg: int

            :param yarg: bla yarg
            :type yarg1: float

            :param str zarg1: bla zarg
            '''
            return xarg + yarg
        R	   s   missing-param-docR
   R   s
   xarg, zargs   missing-type-docs
   yarg, zargs   differing-param-docs   xarg1, zarg1s   differing-type-docs   yarg1, zarg1Nsñ   
        def function_foo(xarg, yarg):
            '''function foo ...

            :param yarg1: bla yarg
            :type yarg1: float

            For the other parameters, see bla.
            '''
            return xarg + yarg
        t   yarg1(   s
   xarg, zarg(   s
   yarg, zarg(   s   xarg1, zarg1(   s   yarg1, zarg1(   R,   (   R,   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt2   test_wrong_name_of_func_params_in_sphinx_docstringœ  s@    	
	c         C` sø   t  j d ƒ } |  j t d d d | d d ƒ t d d d | d d ƒ t d d d | d d ƒ t d d
 d | d d ƒ ƒ  |  j j | ƒ Wd QXt  j d ƒ } |  j t d d d | d d ƒ t d d
 d | d d ƒ ƒ  |  j j | ƒ Wd QXd S(   s~   Example of functions with inconsistent parameter names in the
        signature and in the Google style documentation
        s  
        def function_foo(xarg, yarg, zarg):
            '''function foo ...

            Args:
                xarg1 (int): bla xarg
                yarg (float): bla yarg

                zarg1 (str): bla zarg
            '''
            return xarg + yarg
        R	   s   missing-param-docR
   R   s
   xarg, zargs   missing-type-docs   differing-param-docs   xarg1, zarg1s   differing-type-docNsé   
        def function_foo(xarg, yarg):
            '''function foo ...

            Args:
                yarg1 (float): bla yarg

            For the other parameters, see bla.
            '''
            return xarg + yarg
        R,   (   s
   xarg, zarg(   s
   xarg, zarg(   s   xarg1, zarg1(   s   xarg1, zarg1(   R,   (   R,   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt2   test_wrong_name_of_func_params_in_google_docstringÙ  s@    	
	c         C` sø   t  j d ƒ } |  j t d d d | d d ƒ t d d d | d d ƒ t d d d | d d ƒ t d d
 d | d d ƒ ƒ  |  j j | ƒ Wd QXt  j d ƒ } |  j t d d d | d d ƒ t d d
 d | d d ƒ ƒ  |  j j | ƒ Wd QXd S(   s}   Example of functions with inconsistent parameter names in the
        signature and in the Numpy style documentation
        sE  
        def function_foo(xarg, yarg, zarg):
            '''function foo ...

            Parameters
            ----------
            xarg1: int
                bla xarg
            yarg: float
                bla yarg

            zarg1: str
                bla zarg
            '''
            return xarg + yarg
        R	   s   missing-param-docR
   R   s
   xarg, zargs   missing-type-docs   differing-param-docs   xarg1, zarg1s   differing-type-docNs  
        def function_foo(xarg, yarg):
            '''function foo ...

            Parameters
            ----------
            yarg1: float
                bla yarg

            For the other parameters, see bla.
            '''
            return xarg + yarg
        R,   (   s
   xarg, zarg(   s
   xarg, zarg(   s   xarg1, zarg1(   s   xarg1, zarg1(   R,   (   R,   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt1   test_wrong_name_of_func_params_in_numpy_docstring  s@    		c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sº   Example for the usage of "For the other parameters, see" to avoid
        too many repetitions, e.g. in functions or methods adhering to a
        given interface (Sphinx style)
        sö   
        def function_foo(xarg, yarg):
            '''function foo ...

            :param yarg: bla yarg
            :type yarg: float

            For the other parameters, see :func:`bla`
            '''
            return xarg + yarg
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt5   test_see_sentence_for_func_params_in_sphinx_docstringU  s    
	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sº   Example for the usage of "For the other parameters, see" to avoid
        too many repetitions, e.g. in functions or methods adhering to a
        given interface (Google style)
        sï   
        def function_foo(xarg, yarg):
            '''function foo ...

            Args:
                yarg (float): bla yarg

            For the other parameters, see :func:`bla`
            '''
            return xarg + yarg
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt5   test_see_sentence_for_func_params_in_google_docstringh  s    
	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   s¹   Example for the usage of "For the other parameters, see" to avoid
        too many repetitions, e.g. in functions or methods adhering to a
        given interface (Numpy style)
        s  
        def function_foo(xarg, yarg):
            '''function foo ...

            Parameters
            ----------
            yarg: float
                bla yarg

            For the other parameters, see :func:`bla`
            '''
            return xarg + yarg
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt4   test_see_sentence_for_func_params_in_numpy_docstring{  s    	c      	   C` sc   t  j d ƒ } |  j t d d d | d d
 ƒ t d d d | d d ƒ ƒ  |  j | ƒ Wd	 QXd	 S(   s   Example of a class with missing constructor parameter documentation
        (Sphinx style)

        Everything is completely analogous to functions.
        só   
        class ClassFoo(object):
            '''docstring foo

            :param y: bla
            
            missing constructor parameter documentation
            '''

            def __init__(self, x, y):
                pass

        R	   s   missing-param-docR
   R   t   xs   missing-type-docs   x, yN(   R3   (   s   x, y(   R   R   R   R   R$   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt"   test_constr_params_in_class_sphinx  s    	c      	   C` sc   t  j d ƒ } |  j t d d d | d d
 ƒ t d d d | d d ƒ ƒ  |  j | ƒ Wd	 QXd	 S(   s   Example of a class with missing constructor parameter documentation
        (Google style)

        Everything is completely analogous to functions.
        s  
        class ClassFoo(object):
            '''docstring foo

            Args:
                y: bla
            
            missing constructor parameter documentation
            '''

            def __init__(self, x, y):
                pass

        R	   s   missing-param-docR
   R   R3   s   missing-type-docs   x, yN(   R3   (   s   x, y(   R   R   R   R   R$   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt"   test_constr_params_in_class_google¯  s    	c      	   C` sc   t  j d ƒ } |  j t d d d | d d
 ƒ t d d d | d d ƒ ƒ  |  j | ƒ Wd	 QXd	 S(   sœ   Example of a class with missing constructor parameter documentation
        (Numpy style)

        Everything is completely analogous to functions.
        s*  
        class ClassFoo(object):
            '''docstring foo

            Parameters
            ----------
            y:
                bla
            
            missing constructor parameter documentation
            '''

            def __init__(self, x, y):
                pass

        R	   s   missing-param-docR
   R   R3   s   missing-type-docs   x, yN(   R3   (   s   x, y(   R   R   R   R   R$   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt!   test_constr_params_in_class_numpyÏ  s    	c      	   C` sp   t  j d ƒ } | j d } |  j t d d d | d d ƒ t d d d | d d ƒ ƒ  |  j | ƒ Wd
 QXd
 S(   s   Example of a class with missing constructor parameter documentation
        (Sphinx style)

        Everything is completely analogous to functions.
        s  
        class ClassFoo(object):
            def __init__(self, x, y):
                '''docstring foo constructor

                :param y: bla

                missing constructor parameter documentation
                '''

                pass

        i    R	   s   missing-param-docR
   R   R3   s   missing-type-docs   x, yN(   R3   (   s   x, y(   R   R   R   R   R   R$   (   R   R
   t   constructor_node(    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt!   test_constr_params_in_init_sphinxñ  s    	c      	   C` sp   t  j d ƒ } | j d } |  j t d d d | d d ƒ t d d d | d d ƒ ƒ  |  j | ƒ Wd
 QXd
 S(   s   Example of a class with missing constructor parameter documentation
        (Google style)

        Everything is completely analogous to functions.
        s  
        class ClassFoo(object):
            def __init__(self, x, y):
                '''docstring foo constructor

                Args:
                    y: bla

                missing constructor parameter documentation
                '''
                pass

        i    R	   s   missing-param-docR
   R   R3   s   missing-type-docs   x, yN(   R3   (   s   x, y(   R   R   R   R   R   R$   (   R   R
   R7   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt!   test_constr_params_in_init_google  s    	c      	   C` sp   t  j d ƒ } | j d } |  j t d d d | d d ƒ t d d d | d d ƒ ƒ  |  j | ƒ Wd
 QXd
 S(   sœ   Example of a class with missing constructor parameter documentation
        (Numpy style)

        Everything is completely analogous to functions.
        sE  
        class ClassFoo(object):
            def __init__(self, x, y):
                '''docstring foo constructor

                Parameters
                ----------
                y:
                    bla

                missing constructor parameter documentation
                '''
                pass

        i    R	   s   missing-param-docR
   R   R3   s   missing-type-docs   x, yN(   R3   (   s   x, y(   R   R   R   R   R   R$   (   R   R
   R7   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt    test_constr_params_in_init_numpy1  s    	c         C` s3   t  j d ƒ } |  j ƒ   |  j | ƒ Wd QXd S(   s=   Example usage of "For the parameters, see" in class docstringsß   
        class ClassFoo(object):
            '''docstring foo

            For the parameters, see :func:`bla`
            '''

            def __init__(self, x, y):
                '''init'''
                pass

        N(   R   R   R   R$   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt,   test_see_sentence_for_constr_params_in_classS  s    	c         C` s3   t  j d ƒ } |  j ƒ   |  j | ƒ Wd QXd S(   s<   Example usage of "For the parameters, see" in init docstringsò   
        class ClassFoo(object):
            '''foo'''

            def __init__(self, x, y):
                '''docstring foo constructor

                For the parameters, see :func:`bla`
                '''
                pass

        N(   R   R   R   R$   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt+   test_see_sentence_for_constr_params_in_initd  s    	c         C` s¾   t  j d ƒ } | j d } |  j t d d d | d | j f ƒ t d d d | d d ƒ t d d	 d | d d ƒ t d d d | d d ƒ t d d	 d | d d ƒ ƒ  |  j | ƒ Wd QXd S(   sØ   Example of a class with missing constructor parameter documentation
        in both the init docstring and the class docstring
        (Sphinx style)

        Everything is completely analogous to functions.
        sy  
        class ClassFoo(object):
            '''docstring foo

            :param y: None

            missing constructor parameter documentation
            '''

            def __init__(self, x, y):
                '''docstring foo

                :param y: bla

                missing constructor parameter documentation
                '''
                pass

        i    R	   s   multiple-constructor-docR
   R   s   missing-param-docR3   s   missing-type-docs   x, yN(   R3   (   s   x, y(   R3   (   s   x, y(   R   R   R   R   R   R   R$   (   R   R
   R7   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt+   test_constr_params_in_class_and_init_sphinxv  s2    	c         C` s¾   t  j d ƒ } | j d } |  j t d d d | d | j f ƒ t d d d | d d ƒ t d d	 d | d d ƒ t d d d | d d ƒ t d d	 d | d d ƒ ƒ  |  j | ƒ Wd QXd S(   sØ   Example of a class with missing constructor parameter documentation
        in both the init docstring and the class docstring
        (Google style)

        Everything is completely analogous to functions.
        sš  
        class ClassFoo(object):
            '''docstring foo

            Args:
                y: bla

            missing constructor parameter documentation
            '''

            def __init__(self, x, y):
                '''docstring foo

                Args:
                    y: bla

                missing constructor parameter documentation
                '''
                pass

        i    R	   s   multiple-constructor-docR
   R   s   missing-param-docR3   s   missing-type-docs   x, yN(   R3   (   s   x, y(   R3   (   s   x, y(   R   R   R   R   R   R   R$   (   R   R
   R7   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt+   test_constr_params_in_class_and_init_google©  s2    	c         C` s¾   t  j d ƒ } | j d } |  j t d d d | d | j f ƒ t d d d | d d ƒ t d d	 d | d d ƒ t d d d | d d ƒ t d d	 d | d d ƒ ƒ  |  j | ƒ Wd QXd S(   s×   Example of a class with missing constructor parameter documentation
        in both the init docstring and the class docstring
        (Numpy style)

        Everything is completely analogous to functions.
        sò  
        class ClassFoo(object):
            '''docstring foo

            Parameters
            ----------
            y:
                bla

            missing constructor parameter documentation
            '''

            def __init__(self, x, y):
                '''docstring foo

                Parameters
                ----------
                y:
                    bla

                missing constructor parameter documentation
                '''
                pass

        i    R	   s   multiple-constructor-docR
   R   s   missing-param-docR3   s   missing-type-docs   x, yN(   R3   (   s   x, y(   R3   (   s   x, y(   R   R   R   R   R   R   R$   (   R   R
   R7   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt*   test_constr_params_in_class_and_init_numpyÞ  s2    	i    i   t   reasons   Enabled on Python 3c      	   C` sf   t  j d ƒ } |  j t d d d | d d ƒ t d d d | d d	 ƒ ƒ  |  j j | ƒ Wd  QXd  S(
   NsÅ   
        def my_func(arg, *, kwonly, missing_kwonly):
            """The docstring

            :param int arg: The argument.
            :param bool kwonly: A keyword-arg.
            """
        R	   s   missing-param-docR
   R   t   missing_kwonlys   missing-type-doc(   RA   (   RA   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt$   test_kwonlyargs_are_taken_in_account  s    	c         C` sN   t  j d ƒ } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd  QXd  S(   Ns(  
        def my_func(named_arg, *args):
            """The docstring

            :param named_arg: Returned
            :type named_arg: object
            :returns: Maybe named_arg
            :rtype: object or None
            """
            if args:
                return named_arg
        R	   s   missing-param-docR
   R   (   R   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt   test_warns_missing_args_sphinx,  s    	c         C` sN   t  j d ƒ } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd  QXd  S(   Ns-  
        def my_func(named_arg, **kwargs):
            """The docstring

            :param named_arg: Returned
            :type named_arg: object
            :returns: Maybe named_arg
            :rtype: object or None
            """
            if kwargs:
                return named_arg
        R	   s   missing-param-docR
   R   t   kwargs(   RD   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt    test_warns_missing_kwargs_sphinx@  s    	c         C` sN   t  j d ƒ } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd  QXd  S(   Ns  
        def my_func(named_arg, *args):
            """The docstring

            Args:
                named_arg (object): Returned

            Returns:
                object or None: Maybe named_arg
            """
            if args:
                return named_arg
        R	   s   missing-param-docR
   R   (   R   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt   test_warns_missing_args_googleT  s    	c         C` sN   t  j d ƒ } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd  QXd  S(   Ns  
        def my_func(named_arg, **kwargs):
            """The docstring

            Args:
                named_arg (object): Returned

            Returns:
                object or None: Maybe named_arg
            """
            if kwargs:
                return named_arg
        R	   s   missing-param-docR
   R   RD   (   RD   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt    test_warns_missing_kwargs_googlei  s    	c         C` sN   t  j d ƒ } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd  QXd  S(   NsZ  
        def my_func(named_arg, *args):
            """The docstring

            Args
            ----
            named_arg : object
                Returned

            Returns
            -------
                object or None
                    Maybe named_arg
            """
            if args:
                return named_arg
        R	   s   missing-param-docR
   R   (   R   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt   test_warns_missing_args_numpy~  s    	c         C` sN   t  j d ƒ } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd  QXd  S(   Ns_  
        def my_func(named_arg, **kwargs):
            """The docstring

            Args
            ----
            named_arg : object
                Returned

            Returns
            -------
                object or None
                    Maybe named_arg
            """
            if kwargs:
                return named_arg
        R	   s   missing-param-docR
   R   RD   (   RD   (   R   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt   test_warns_missing_kwargs_numpy—  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   NsT  
        def my_func(named_arg, *args):
            """The docstring

            :param named_arg: Returned
            :type named_arg: object
            :param args: Optional arguments
            :returns: Maybe named_arg
            :rtype: object or None
            """
            if args:
                return named_arg
        (   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt#   test_finds_args_without_type_sphinx°  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   NsZ  
        def my_func(named_arg, **kwargs):
            """The docstring

            :param named_arg: Returned
            :type named_arg: object
            :param kwargs: Keyword arguments
            :returns: Maybe named_arg
            :rtype: object or None
            """
            if kwargs:
                return named_arg
        (   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt%   test_finds_kwargs_without_type_sphinxÁ  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   NsC  
        def my_func(named_arg, *args):
            """The docstring

            Args:
                named_arg (object): Returned
                *args: Optional arguments

            Returns:
                object or None: Maybe named_arg
            """
            if args:
                return named_arg
        (   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt#   test_finds_args_without_type_googleÒ  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   NsJ  
        def my_func(named_arg, **kwargs):
            """The docstring

            Args:
                named_arg (object): Returned
                **kwargs: Keyword arguments

            Returns:
                object or None: Maybe named_arg
            """
            if kwargs:
                return named_arg
        (   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt%   test_finds_kwargs_without_type_googleä  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   Ns  
        def my_func(named_arg, *args):
            """The docstring

            Args
            ----
            named_arg : object
                Returned
            args :
                Optional Arguments

            Returns
            -------
                object or None
                    Maybe named_arg
            """
            if args:
                return named_arg
        (   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt"   test_finds_args_without_type_numpyö  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   NsT  
        def my_func(named_arg, **kwargs):
            """The docstring

            Args:
                named_arg (`example.value`): Returned
                **kwargs: Keyword arguments

            Returns:
                `example.value`: Maybe named_arg
            """
            if kwargs:
                return named_arg
        (   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt%   test_finds_args_with_xref_type_google  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   Nsš  
        def my_func(named_arg, *args):
            """The docstring

            Args
            ----
            named_arg : `example.value`
                Returned
            args :
                Optional Arguments

            Returns
            -------
                `example.value`
                    Maybe named_arg
            """
            if args:
                return named_arg
        (   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt$   test_finds_args_with_xref_type_numpy  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   Ns–  
        def my_func(named_arg, **kwargs):
            """The docstring

            Args
            ----
            named_arg : object
                Returned
            kwargs :
                Keyword arguments

            Returns
            -------
                object or None
                    Maybe named_arg
            """
            if kwargs:
                return named_arg
        (   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt$   test_finds_kwargs_without_type_numpy6  s    	s   dict(str,str)s   dict[str,str]s
   tuple(int)s   list[tokenize.TokenInfo]s   dict(str, str)s   dict[str, str]s
   int or strs   tuple(int or str)s   tuple(int) or list(int)s%   tuple(int or str) or list(int or str)t   complex_typec         C` s?   t  j d j | ƒ ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   Nsõ   
        def my_func(named_arg):
            """The docstring

            :param named_arg: Returned
            :type named_arg: {0}

            :returns: named_arg
            :rtype: {0}
            """
            return named_arg
        (   R   R   t   formatR   R   R   (   R   RR   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt    test_finds_multiple_types_sphinx]  s    c         C` s?   t  j d j | ƒ ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   Nså   
        def my_func(named_arg):
            """The docstring

            Args:
                named_arg ({0}): Returned

            Returns:
                {0}: named_arg
            """
            return named_arg
        (   R   R   RS   R   R   R   (   R   RR   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt    test_finds_multiple_types_googlen  s    c         C` s?   t  j d j | ƒ ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   Ns&  
        def my_func(named_arg):
            """The docstring

            Args
            ----
            named_arg : {0}
                Returned

            Returns
            -------
                {0}
                    named_arg
            """
            return named_arg
        (   R   R   RS   R   R   R   (   R   RR   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt   test_finds_multiple_types_numpy  s    t   container_typec         C` s?   t  j d j | ƒ ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   NsØ   
        def my_func(named_arg):
            """The docstring

            :param {0} named_arg: Returned

            :returns: named_arg
            :rtype: {0}
            """
            return named_arg
        (   R   R   RS   R   R   R   (   R   RW   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt)   test_finds_compact_container_types_sphinx”  s    
c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   Ns—  
        def do_something(param, param2='all'):
            """Do something.

            Parameters
            ----------
            param : str
                Description.
            param2 : str, optional
                Description (the default is 'all').

            Returns
            -------
            int
                Description.
            """
            return param, param2
        (   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt%   test_ignores_optional_specifier_numpy¤  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd  QXd  S(   Ns  
        from fake_package import BadError

        def do_something(): #@
            """Do something.

            Raises:
                ~fake_package.exceptions.BadError: When something bad happened.
            """
            raise BadError("A bad thing happened.")
        (   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt   test_finds_short_name_exceptionº  s    
	c         C` sT   t  j d ƒ \ } } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd QXd S(	   sv   Example of a setter having missing raises documentation in
        the Sphinx style docstring of the property
        s(  
        class Foo(object):
            @property
            def foo(self): #@
                '''docstring ...

                :type: int
                '''
                return 10

            @foo.setter
            def foo(self, value):
                raise AttributeError() #@
        R	   s   missing-raises-docR
   R   t   AttributeErrorN(   R[   (   R   R   R   R   R   t   visit_raise(   R   t   property_nodeR
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt,   test_finds_missing_raises_from_setter_sphinxÉ  s    c         C` sT   t  j d ƒ \ } } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd QXd S(	   sv   Example of a setter having missing raises documentation in
        the Google style docstring of the property
        sý  
        class Foo(object):
            @property
            def foo(self): #@
                '''int: docstring

                Include a "Raises" section so that this is identified
                as a Google docstring and not a Numpy docstring.

                Raises:
                    RuntimeError: Always
                '''
                raise RuntimeError()
                return 10

            @foo.setter
            def foo(self, value):
                raises AttributeError() #@
        R	   s   missing-raises-docR
   R   R[   N(   R[   (   R   R   R   R   R   R\   (   R   R]   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt,   test_finds_missing_raises_from_setter_googleã  s    c         C` sT   t  j d ƒ \ } } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd QXd S(	   su   Example of a setter having missing raises documentation in
        the Numpy style docstring of the property
        s"  
        class Foo(object):
            @property
            def foo(self): #@
                '''int: docstring

                Include a "Raises" section so that this is identified
                as a Numpy docstring and not a Google docstring.

                Raises
                ------
                RuntimeError
                    Always
                '''
                raise RuntimeError()
                return 10

            @foo.setter
            def foo(self, value):
                raises AttributeError() #@
        R	   s   missing-raises-docR
   R   R[   N(   R[   (   R   R   R   R   R   R\   (   R   R]   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt+   test_finds_missing_raises_from_setter_numpy  s    c         C` sT   t  j d ƒ \ } } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd QXd S(	   sj   Example of a setter having missing raises documentation in
        its own Sphinx style docstring
        sÓ  
        class Foo(object):
            @property
            def foo(self):
                '''docstring ...

                :type: int
                :raises RuntimeError: Always
                '''
                raise RuntimeError()
                return 10

            @foo.setter
            def foo(self, value): #@
                '''setter docstring ...

                :type: None
                '''
                raise AttributeError() #@
        R	   s   missing-raises-docR
   R   R[   N(   R[   (   R   R   R   R   R   R\   (   R   t   setter_nodeR
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt*   test_finds_missing_raises_in_setter_sphinx#  s    c         C` sT   t  j d ƒ \ } } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd QXd S(	   sz   Example of a setter having missing raises documentation in
        its own Google style docstring of the property
        s7  
        class Foo(object):
            @property
            def foo(self):
                '''int: docstring ...

                Raises:
                    RuntimeError: Always
                '''
                raise RuntimeError()
                return 10

            @foo.setter
            def foo(self, value): #@
                '''setter docstring ...

                Raises:
                    RuntimeError: Never
                '''
                if True:
                    raise AttributeError() #@
                raise RuntimeError()
        R	   s   missing-raises-docR
   R   R[   N(   R[   (   R   R   R   R   R   R\   (   R   Ra   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyR_   C  s    c         C` sT   t  j d ƒ \ } } |  j t d d d | d d ƒ ƒ  |  j j | ƒ Wd QXd S(	   sy   Example of a setter having missing raises documentation in
        its own Numpy style docstring of the property
        s  
        class Foo(object):
            @property
            def foo(self):
                '''int: docstring ...

                Raises
                ------
                RuntimeError
                    Always
                '''
                raise RuntimeError()
                return 10

            @foo.setter
            def foo(self, value): #@
                '''setter docstring ...

                Raises
                ------
                RuntimeError
                    Never
                '''
                if True:
                    raise AttributeError() #@
                raise RuntimeError()
        R	   s   missing-raises-docR
   R   R[   N(   R[   (   R   R   R   R   R   R\   (   R   Ra   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyR`   f  s    c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   s^   Example of a property having return documentation in
        a Sphinx style docstring
        sÃ   
        class Foo(object):
            @property
            def foo(self): #@
                '''docstring ...

                :type: int
                '''
                return 10
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt&   test_finds_property_return_type_sphinx  s    		c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   s^   Example of a property having return documentation in
        a Google style docstring
        s  
        class Foo(object):
            @property
            def foo(self): #@
                '''int: docstring ...

                Raises:
                    RuntimeError: Always
                '''
                raise RuntimeError()
                return 10
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt&   test_finds_property_return_type_googlež  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   s]   Example of a property having return documentation in
        a numpy style docstring
        s8  
        class Foo(object):
            @property
            def foo(self): #@
                '''int: docstring ...

                Raises
                ------
                RuntimeError
                    Always
                '''
                raise RuntimeError()
                return 10
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt%   test_finds_property_return_type_numpy±  s    	c         C` sN   t  j d ƒ \ } } |  j t d d d | ƒ ƒ  |  j j | ƒ Wd QXd S(   sf   Example of a property having missing return documentation in
        a Sphinx style docstring
        sý   
        class Foo(object):
            @property
            def foo(self): #@
                '''docstring ...

                :raises RuntimeError: Always
                '''
                raise RuntimeError()
                return 10 #@
        R	   s   missing-return-type-docR
   N(   R   R   R   R   R   t   visit_return(   R   R]   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt.   test_finds_missing_property_return_type_sphinxÆ  s    
c         C` sN   t  j d ƒ \ } } |  j t d d d | ƒ ƒ  |  j j | ƒ Wd QXd S(   s^   Example of a property having return documentation in
        a Google style docstring
        s  
        class Foo(object):
            @property
            def foo(self): #@
                '''docstring ...

                Raises:
                    RuntimeError: Always
                '''
                raise RuntimeError()
                return 10 #@
        R	   s   missing-return-type-docR
   N(   R   R   R   R   R   Rf   (   R   R]   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt.   test_finds_missing_property_return_type_googleÜ  s    c         C` sN   t  j d ƒ \ } } |  j t d d d | ƒ ƒ  |  j j | ƒ Wd QXd S(   s]   Example of a property having return documentation in
        a numpy style docstring
        s6  
        class Foo(object):
            @property
            def foo(self): #@
                '''docstring ...

                Raises
                ------
                RuntimeError
                    Always
                '''
                raise RuntimeError()
                return 10 #@
        R	   s   missing-return-type-docR
   N(   R   R   R   R   R   Rf   (   R   R]   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt-   test_finds_missing_property_return_type_numpyó  s    c         C` s`   t  j d ƒ \ } } |  j t d d d | ƒ t d d d | ƒ ƒ  |  j j | ƒ Wd QXd S(   su   Example of a class function trying to use `type` as return
        documentation in a Sphinx style docstring
        s°   
        class Foo(object):
            def foo(self): #@
                '''docstring ...

                :type: int
                '''
                return 10 #@
        R	   s   missing-return-docR
   s   missing-return-type-docN(   R   R   R   R   R   Rf   (   R   t	   func_nodeR
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt,   test_ignores_non_property_return_type_sphinx  s    c         C` s`   t  j d ƒ \ } } |  j t d d d | ƒ t d d d | ƒ ƒ  |  j j | ƒ Wd QXd S(   su   Example of a class function trying to use `type` as return
        documentation in a Google style docstring
        s   
        class Foo(object):
            def foo(self): #@
                '''int: docstring ...

                Raises:
                    RuntimeError: Always
                '''
                raise RuntimeError()
                return 10 #@
        R	   s   missing-return-docR
   s   missing-return-type-docN(   R   R   R   R   R   Rf   (   R   Rj   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt,   test_ignores_non_property_return_type_google#  s    
c         C` s`   t  j d ƒ \ } } |  j t d d d | ƒ t d d d | ƒ ƒ  |  j j | ƒ Wd QXd S(   st   Example of a class function trying to use `type` as return
        documentation in a numpy style docstring
        s%  
        class Foo(object):
            def foo(self): #@
                '''int: docstring ...

                Raises
                ------
                RuntimeError
                    Always
                '''
                raise RuntimeError()
                return 10 #@
        R	   s   missing-return-docR
   s   missing-return-type-docN(   R   R   R   R   R   Rf   (   R   Rj   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt+   test_ignores_non_property_return_type_numpy<  s    c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sp   Example of an abstract method documenting the return type that an
        implementation should return.
        sÿ   
        import abc
        class Foo(object):
            @abc.abstractmethod
            def foo(self): #@
                '''docstring ...

                :returns: Ten
                :rtype: int
                '''
                return 10
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt-   test_ignores_return_in_abstract_method_sphinxW  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sp   Example of an abstract method documenting the return type that an
        implementation should return.
        sû   
        import abc
        class Foo(object):
            @abc.abstractmethod
            def foo(self): #@
                '''docstring ...

                Returns:
                    int: Ten
                '''
                return 10
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt-   test_ignores_return_in_abstract_method_googlej  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sp   Example of an abstract method documenting the return type that an
        implementation should return.
        s!  
        import abc
        class Foo(object):
            @abc.abstractmethod
            def foo(self): #@
                '''docstring ...

                Returns
                -------
                int
                    Ten
                '''
                return 10
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt,   test_ignores_return_in_abstract_method_numpy}  s    	c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   s   Example of an abstract
        sñ   
        class Foo(object):
            def foo(self, arg): #@
                '''docstring ...

                :param arg: An argument.
                :type arg: int
                '''
                raise NotImplementedError()
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt-   test_ignores_raise_notimplementederror_sphinx’  s    		c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sf   Example of a method documenting the return type that an
        implementation should return.
        së   
        class Foo(object):
            def foo(self, arg): #@
                '''docstring ...

                Args:
                    arg (int): An argument.
                '''
                raise NotImplementedError()
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyRo   ¢  s    		c         C` s6   t  j d ƒ } |  j ƒ   |  j j | ƒ Wd QXd S(   sf   Example of a method documenting the return type that an
        implementation should return.
        s  
        class Foo(object):
            def foo(self, arg): #@
                '''docstring ...

                Parameters
                ----------
                arg : int
                    An argument.
                '''
                raise NotImplementedError()
        N(   R   R   R   R   R   (   R   R
   (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyRp   ³  s    	(W   t   __name__t
   __module__t   __doc__R   t   CHECKER_CLASSt   Falset   CONFIGR   R   R   R   R   R   t   TrueR   R   R   R$   R&   R'   R(   R)   R*   R+   R-   R.   R/   R0   R1   R2   R4   R5   R6   R8   R9   R:   R;   R<   R=   R>   R?   t   pytestt   markt   skipift   syst   version_infoRB   RC   RE   RF   RG   RH   RI   RJ   RK   RL   RM   RN   RO   RP   RQ   t   CONTAINER_TYPESt   COMPLEX_TYPESt   parametrizeRT   RU   RV   RX   RY   RZ   R^   R_   R`   Rb   Rc   Rd   Re   Rg   Rh   Ri   Rk   Rl   Rm   Rn   Ro   Rp   Rq   (    (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyR      s²   
				%											=	;	A					 	"	 	 	"			3	5	9.															
					!	 	#	'														(   Rt   t
   __future__R    R   R   R|   Ry   R   t   pylint.testutilsR   R   R   t   pylint.extensions.docparamsR   R   (    (    (    sE   lib/python2.7/site-packages/pylint/test/extensions/test_check_docs.pyt   <module>   s   