summaryrefslogtreecommitdiff
path: root/pylint/extensions
diff options
context:
space:
mode:
authorBruno Daniel <bruno.daniel@blue-yonder.com>2015-05-10 13:02:22 +0200
committerBruno Daniel <bruno.daniel@blue-yonder.com>2015-05-10 13:02:22 +0200
commitaf4c5ea511f17aef533b18a01b93fad7a1557310 (patch)
treef07745d62fb32160b528bdcde7712e67b720b6c6 /pylint/extensions
parent96d2e38b51b59fa30c130cfdfae15f58ac8c6709 (diff)
downloadpylint-af4c5ea511f17aef533b18a01b93fad7a1557310.tar.gz
unit test for see sentence in Google and Numpy style docstring
Diffstat (limited to 'pylint/extensions')
-rw-r--r--pylint/extensions/test/test_check_docs.py44
1 files changed, 42 insertions, 2 deletions
diff --git a/pylint/extensions/test/test_check_docs.py b/pylint/extensions/test/test_check_docs.py
index b8e61e7..8f311ff 100644
--- a/pylint/extensions/test/test_check_docs.py
+++ b/pylint/extensions/test/test_check_docs.py
@@ -445,10 +445,10 @@ class SpinxDocCheckerTest(CheckerTestCase):
):
self.checker.visit_function(node)
- def test_see_sentence_for_func_params_in_docstring(self):
+ def test_see_sentence_for_func_params_in_sphinx_docstring(self):
"""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
+ given interface (Sphinx style)
"""
node = test_utils.extract_node("""
def function_foo(xarg, yarg):
@@ -464,6 +464,46 @@ class SpinxDocCheckerTest(CheckerTestCase):
with self.assertNoMessages():
self.checker.visit_function(node)
+ def test_see_sentence_for_func_params_in_google_docstring(self):
+ """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)
+ """
+ node = test_utils.extract_node("""
+ def function_foo(xarg, yarg):
+ '''function foo ...
+
+ Args:
+ yarg (float): bla yarg
+
+ For the other parameters, see :func:`bla`
+ '''
+ return xarg + yarg
+ """)
+ with self.assertNoMessages():
+ self.checker.visit_function(node)
+
+ def test_see_sentence_for_func_params_in_numpy_docstring(self):
+ """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)
+ """
+ node = test_utils.extract_node("""
+ def function_foo(xarg, yarg):
+ '''function foo ...
+
+ Parameters
+ ----------
+ yarg: float
+ bla yarg
+
+ For the other parameters, see :func:`bla`
+ '''
+ return xarg + yarg
+ """)
+ with self.assertNoMessages():
+ self.checker.visit_function(node)
+
def test_constr_params_in_class(self):
"""Example of a class with missing constructor parameter documentation