diff options
author | Ashley Whetter <AWhetter@users.noreply.github.com> | 2018-02-16 22:10:10 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-16 22:10:10 -0800 |
commit | bd38d67ab5cba0d850c54753677c8f5f40b38004 (patch) | |
tree | 08ba00741be7a4b5e50b8bc85e23d1c8732d66f3 /pylint/test/extensions | |
parent | 3474c122aa31fce813c4427bd79097ee8099d0ee (diff) | |
download | pylint-git-bd38d67ab5cba0d850c54753677c8f5f40b38004.tar.gz |
Fixed false positive when a numpy Attributes section follows a Parameters section (#1878)
Fixes #1867
Diffstat (limited to 'pylint/test/extensions')
-rw-r--r-- | pylint/test/extensions/test_check_docs.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pylint/test/extensions/test_check_docs.py b/pylint/test/extensions/test_check_docs.py index 3950cedb9..50ec44d17 100644 --- a/pylint/test/extensions/test_check_docs.py +++ b/pylint/test/extensions/test_check_docs.py @@ -750,6 +750,29 @@ class TestParamDocChecker(CheckerTestCase): ): self._visit_methods_of_class(node) + def test_constr_params_and_attributes_in_class_numpy(self): + """Example of a class with correct constructor parameter documentation + and an attributes section (Numpy style) + """ + node = astroid.extract_node(""" + class ClassFoo(object): + ''' + Parameters + ---------- + foo : str + Something. + + Attributes + ---------- + bar : str + Something. + ''' + def __init__(self, foo): + self.bar = None + """) + with self.assertNoMessages(): + self._visit_methods_of_class(node) + def test_constr_params_in_init_sphinx(self): """Example of a class with missing constructor parameter documentation (Sphinx style) |