summaryrefslogtreecommitdiff
path: root/tests/extensions
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2021-12-12 23:26:43 +0100
committerGitHub <noreply@github.com>2021-12-12 23:26:43 +0100
commitf8b23eb9cccf4bda452bf56dc1c71b8a046e571b (patch)
tree050efc17b90e701249787ad5fb57a5c17901d4d0 /tests/extensions
parentcbf39764474529b03eea206801fb8f456a2da9b2 (diff)
downloadpylint-git-f8b23eb9cccf4bda452bf56dc1c71b8a046e571b.tar.gz
Move ``Numpy`` tests from ``TestParamDocChecker`` to functional tests (#5507)
Diffstat (limited to 'tests/extensions')
-rw-r--r--tests/extensions/test_check_docs.py140
1 files changed, 0 insertions, 140 deletions
diff --git a/tests/extensions/test_check_docs.py b/tests/extensions/test_check_docs.py
index 37a5e62bc..aab3bd761 100644
--- a/tests/extensions/test_check_docs.py
+++ b/tests/extensions/test_check_docs.py
@@ -184,146 +184,6 @@ class TestParamDocChecker(CheckerTestCase):
with self.assertNoMessages():
self.checker.visit_functiondef(node)
- def test_finds_missing_raises_from_setter_numpy_2(self) -> None:
- """Example of a setter having missing raises documentation in
- its own Numpy style docstring of the property
- """
- setter_node, node = astroid.extract_node(
- """
- 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()
- """
- )
- with self.assertAddsMessages(
- MessageTest(
- msg_id="missing-raises-doc", node=setter_node, args=("AttributeError",)
- )
- ):
- self.checker.visit_raise(node)
-
- def test_finds_property_return_type_numpy(self) -> None:
- """Example of a property having return documentation in
- a numpy style docstring
- """
- node = astroid.extract_node(
- """
- class Foo(object):
- @property
- def foo(self): #@
- '''int: docstring ...
-
- Raises
- ------
- RuntimeError
- Always
- '''
- raise RuntimeError()
- return 10
- """
- )
- with self.assertNoMessages():
- self.checker.visit_functiondef(node)
-
- @set_config(accept_no_return_doc="no")
- def test_finds_missing_property_return_type_numpy(self) -> None:
- """Example of a property having return documentation in
- a numpy style docstring
- """
- property_node, node = astroid.extract_node(
- """
- class Foo(object):
- @property
- def foo(self): #@
- '''docstring ...
-
- Raises
- ------
- RuntimeError
- Always
- '''
- raise RuntimeError()
- return 10 #@
- """
- )
- with self.assertAddsMessages(
- MessageTest(msg_id="missing-return-type-doc", node=property_node)
- ):
- self.checker.visit_return(node)
-
- @set_config(accept_no_return_doc="no")
- def test_ignores_non_property_return_type_numpy(self) -> None:
- """Example of a class function trying to use `type` as return
- documentation in a numpy style docstring
- """
- func_node, node = astroid.extract_node(
- """
- class Foo(object):
- def foo(self): #@
- '''int: docstring ...
-
- Raises
- ------
- RuntimeError
- Always
- '''
- raise RuntimeError()
- return 10 #@
- """
- )
- with self.assertAddsMessages(
- MessageTest(msg_id="missing-return-doc", node=func_node),
- MessageTest(msg_id="missing-return-type-doc", node=func_node),
- ):
- self.checker.visit_return(node)
-
- @set_config(accept_no_return_doc="no")
- def test_non_property_annotation_return_type_numpy(self) -> None:
- """Example of a class function trying to use `type` as return
- documentation in a numpy style docstring
- """
- func_node, node = astroid.extract_node(
- """
- class Foo(object):
- def foo(self) -> int: #@
- '''int: docstring ...
-
- Raises
- ------
- RuntimeError
- Always
- '''
- raise RuntimeError()
- return 10 #@
- """
- )
- with self.assertAddsMessages(
- MessageTest(msg_id="missing-return-doc", node=func_node)
- ):
- self.checker.visit_return(node)
-
@set_config_directly(no_docstring_rgx=re.compile(r"^_(?!_).*$"))
def test_skip_no_docstring_rgx(self) -> None:
"""Example of a function that matches the default 'no-docstring-rgx' config option