summaryrefslogtreecommitdiff
path: root/pylint/test/extensions/test_check_docs.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-08-26 22:09:27 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2015-08-26 22:09:27 +0300
commita1b3c9623afe3c5993d183ec9e6d1baceb7cc3ae (patch)
treef6bbd572abdb6695db5c051ec180486184d0e9b4 /pylint/test/extensions/test_check_docs.py
parent1746fce4e595f4b20982892dc6e6a0bd13556597 (diff)
downloadpylint-git-a1b3c9623afe3c5993d183ec9e6d1baceb7cc3ae.tar.gz
Use the new node names for the visit and leave methods
Also, emit a PendingDeprecationWarning if the old names are still used, this support being removed in pylint 2.0.
Diffstat (limited to 'pylint/test/extensions/test_check_docs.py')
-rw-r--r--pylint/test/extensions/test_check_docs.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/pylint/test/extensions/test_check_docs.py b/pylint/test/extensions/test_check_docs.py
index 07afb3ec2..3a5455a46 100644
--- a/pylint/test/extensions/test_check_docs.py
+++ b/pylint/test/extensions/test_check_docs.py
@@ -47,7 +47,7 @@ class ParamDocCheckerTest(CheckerTestCase):
node=node,
args=('x, y',))
):
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_missing_func_params_in_google_docstring(self):
"""Example of a function with missing Google style parameter
@@ -75,7 +75,7 @@ class ParamDocCheckerTest(CheckerTestCase):
node=node,
args=('x, y',))
):
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_missing_func_params_in_numpy_docstring(self):
"""Example of a function with missing NumPy style parameter
@@ -106,7 +106,7 @@ class ParamDocCheckerTest(CheckerTestCase):
node=node,
args=('x, y',))
):
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_tolerate_no_param_documentation_at_all(self):
"""Example of a function with no parameter documentation at all
@@ -121,7 +121,7 @@ class ParamDocCheckerTest(CheckerTestCase):
pass
""")
with self.assertNoMessages():
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
@set_config(accept_no_param_doc=False)
def test_don_t_tolerate_no_param_documentation_at_all(self):
@@ -146,7 +146,7 @@ class ParamDocCheckerTest(CheckerTestCase):
node=node,
args=('x, y',))
):
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def _visit_methods_of_class(self, node):
"""Visit all methods of a class node
@@ -157,7 +157,7 @@ class ParamDocCheckerTest(CheckerTestCase):
for body_item in node.body:
if (isinstance(body_item, astroid.FunctionDef)
and hasattr(body_item, 'name')):
- self.checker.visit_function(body_item)
+ self.checker.visit_functiondef(body_item)
def test_missing_method_params_in_sphinx_docstring(self):
"""Example of a class method with missing parameter documentation in
@@ -269,7 +269,7 @@ class ParamDocCheckerTest(CheckerTestCase):
return xarg + yarg
""")
with self.assertNoMessages():
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_existing_func_params_in_google_docstring(self):
"""Example of a function with correctly documented parameters and
@@ -292,7 +292,7 @@ class ParamDocCheckerTest(CheckerTestCase):
return xarg + yarg
""")
with self.assertNoMessages():
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_existing_func_params_in_numpy_docstring(self):
"""Example of a function with correctly documented parameters and
@@ -320,7 +320,7 @@ class ParamDocCheckerTest(CheckerTestCase):
return xarg + yarg
""")
with self.assertNoMessages():
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_wrong_name_of_func_params_in_sphinx_docstring(self):
"""Example of functions with inconsistent parameter names in the
@@ -350,7 +350,7 @@ class ParamDocCheckerTest(CheckerTestCase):
node=node,
args=('yarg, yarg1, zarg, zarg1',)),
):
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
node = test_utils.extract_node("""
def function_foo(xarg, yarg):
@@ -373,7 +373,7 @@ class ParamDocCheckerTest(CheckerTestCase):
node=node,
args=('yarg1',))
):
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_wrong_name_of_func_params_in_google_docstring(self):
"""Example of functions with inconsistent parameter names in the
@@ -401,7 +401,7 @@ class ParamDocCheckerTest(CheckerTestCase):
node=node,
args=('xarg, xarg1, zarg, zarg1',)),
):
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
node = test_utils.extract_node("""
def function_foo(xarg, yarg):
@@ -424,7 +424,7 @@ class ParamDocCheckerTest(CheckerTestCase):
node=node,
args=('yarg1',))
):
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_wrong_name_of_func_params_in_numpy_docstring(self):
"""Example of functions with inconsistent parameter names in the
@@ -456,7 +456,7 @@ class ParamDocCheckerTest(CheckerTestCase):
node=node,
args=('xarg, xarg1, zarg, zarg1',)),
):
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
node = test_utils.extract_node("""
def function_foo(xarg, yarg):
@@ -481,7 +481,7 @@ class ParamDocCheckerTest(CheckerTestCase):
node=node,
args=('yarg1',))
):
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_see_sentence_for_func_params_in_sphinx_docstring(self):
"""Example for the usage of "For the other parameters, see" to avoid
@@ -500,7 +500,7 @@ class ParamDocCheckerTest(CheckerTestCase):
return xarg + yarg
""")
with self.assertNoMessages():
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_see_sentence_for_func_params_in_google_docstring(self):
"""Example for the usage of "For the other parameters, see" to avoid
@@ -519,7 +519,7 @@ class ParamDocCheckerTest(CheckerTestCase):
return xarg + yarg
""")
with self.assertNoMessages():
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_see_sentence_for_func_params_in_numpy_docstring(self):
"""Example for the usage of "For the other parameters, see" to avoid
@@ -540,7 +540,7 @@ class ParamDocCheckerTest(CheckerTestCase):
return xarg + yarg
""")
with self.assertNoMessages():
- self.checker.visit_function(node)
+ self.checker.visit_functiondef(node)
def test_constr_params_in_class_sphinx(self):
"""Example of a class with missing constructor parameter documentation