diff options
Diffstat (limited to 'tests/extensions/test_check_return_docs.py')
-rw-r--r-- | tests/extensions/test_check_return_docs.py | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/tests/extensions/test_check_return_docs.py b/tests/extensions/test_check_return_docs.py index 6f3baa92a..3e165561e 100644 --- a/tests/extensions/test_check_return_docs.py +++ b/tests/extensions/test_check_return_docs.py @@ -31,7 +31,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): CHECKER_CLASS = DocstringParameterChecker - def test_ignores_no_docstring(self): + def test_ignores_no_docstring(self) -> None: return_node = astroid.extract_node( """ def my_func(self): @@ -42,7 +42,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): self.checker.visit_return(return_node) @set_config(accept_no_return_doc=False) - def test_warns_no_docstring(self): + def test_warns_no_docstring(self) -> None: node = astroid.extract_node( """ def my_func(self): @@ -56,7 +56,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_return(return_node) - def test_ignores_unknown_style(self): + def test_ignores_unknown_style(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -67,7 +67,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_warn_partial_sphinx_returns(self): + def test_warn_partial_sphinx_returns(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -84,7 +84,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_return(return_node) - def test_sphinx_missing_return_type_with_annotations(self): + def test_sphinx_missing_return_type_with_annotations(self) -> None: node = astroid.extract_node( ''' def my_func(self) -> bool: @@ -99,7 +99,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_warn_partial_sphinx_returns_type(self): + def test_warn_partial_sphinx_returns_type(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -114,7 +114,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertAddsMessages(Message(msg_id="missing-return-doc", node=node)): self.checker.visit_return(return_node) - def test_warn_missing_sphinx_returns(self): + def test_warn_missing_sphinx_returns(self) -> None: node = astroid.extract_node( ''' def my_func(self, doc_type): @@ -133,7 +133,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_return(return_node) - def test_warn_partial_google_returns(self): + def test_warn_partial_google_returns(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -151,7 +151,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_return(return_node) - def test_warn_partial_google_returns_type(self): + def test_warn_partial_google_returns_type(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -167,7 +167,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertAddsMessages(Message(msg_id="missing-return-doc", node=node)): self.checker.visit_return(return_node) - def test_warn_missing_google_returns(self): + def test_warn_missing_google_returns(self) -> None: node = astroid.extract_node( ''' def my_func(self, doc_type): @@ -186,7 +186,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_return(return_node) - def test_warn_partial_numpy_returns_type(self): + def test_warn_partial_numpy_returns_type(self) -> None: node = astroid.extract_node( ''' def my_func(self, doc_type): @@ -208,7 +208,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertAddsMessages(Message(msg_id="missing-return-doc", node=node)): self.checker.visit_return(return_node) - def test_warn_missing_numpy_returns(self): + def test_warn_missing_numpy_returns(self) -> None: node = astroid.extract_node( ''' def my_func(self, doc_type): @@ -229,7 +229,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_return(return_node) - def test_find_sphinx_returns(self): + def test_find_sphinx_returns(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -244,7 +244,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_find_google_returns(self): + def test_find_google_returns(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -259,7 +259,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_find_numpy_returns(self): + def test_find_numpy_returns(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -276,7 +276,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_find_numpy_returns_with_of(self): + def test_find_numpy_returns_with_of(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -293,7 +293,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_ignores_sphinx_return_none(self): + def test_ignores_sphinx_return_none(self) -> None: return_node = astroid.extract_node( ''' def my_func(self, doc_type): @@ -308,7 +308,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_ignores_google_return_none(self): + def test_ignores_google_return_none(self) -> None: return_node = astroid.extract_node( ''' def my_func(self, doc_type): @@ -323,7 +323,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_ignores_numpy_return_none(self): + def test_ignores_numpy_return_none(self) -> None: return_node = astroid.extract_node( ''' def my_func(self, doc_type): @@ -340,7 +340,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_finds_sphinx_return_custom_class(self): + def test_finds_sphinx_return_custom_class(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -355,7 +355,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_finds_google_return_custom_class(self): + def test_finds_google_return_custom_class(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -370,7 +370,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_finds_numpy_return_custom_class(self): + def test_finds_numpy_return_custom_class(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -387,7 +387,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_finds_sphinx_return_list_of_custom_class(self): + def test_finds_sphinx_return_list_of_custom_class(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -402,7 +402,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_finds_google_return_list_of_custom_class(self): + def test_finds_google_return_list_of_custom_class(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -417,7 +417,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_finds_numpy_return_list_of_custom_class(self): + def test_finds_numpy_return_list_of_custom_class(self) -> None: return_node = astroid.extract_node( ''' def my_func(self): @@ -434,7 +434,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_return(return_node) - def test_warns_sphinx_return_list_of_custom_class_without_description(self): + def test_warns_sphinx_return_list_of_custom_class_without_description(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -449,7 +449,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertAddsMessages(Message(msg_id="missing-return-doc", node=node)): self.checker.visit_return(return_node) - def test_warns_google_return_list_of_custom_class_without_description(self): + def test_warns_google_return_list_of_custom_class_without_description(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -465,7 +465,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertAddsMessages(Message(msg_id="missing-return-doc", node=node)): self.checker.visit_return(return_node) - def test_warns_numpy_return_list_of_custom_class_without_description(self): + def test_warns_numpy_return_list_of_custom_class_without_description(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -482,7 +482,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertAddsMessages(Message(msg_id="missing-return-doc", node=node)): self.checker.visit_return(return_node) - def test_warns_sphinx_redundant_return_doc(self): + def test_warns_sphinx_redundant_return_doc(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -498,7 +498,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_functiondef(node) - def test_warns_sphinx_redundant_rtype_doc(self): + def test_warns_sphinx_redundant_rtype_doc(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -514,7 +514,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_functiondef(node) - def test_warns_google_redundant_return_doc(self): + def test_warns_google_redundant_return_doc(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -531,7 +531,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_functiondef(node) - def test_warns_google_redundant_rtype_doc(self): + def test_warns_google_redundant_rtype_doc(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -548,7 +548,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_functiondef(node) - def test_warns_numpy_redundant_return_doc(self): + def test_warns_numpy_redundant_return_doc(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -567,7 +567,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_functiondef(node) - def test_warns_numpy_redundant_rtype_doc(self): + def test_warns_numpy_redundant_rtype_doc(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -585,7 +585,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_functiondef(node) - def test_ignores_sphinx_redundant_return_doc_multiple_returns(self): + def test_ignores_sphinx_redundant_return_doc_multiple_returns(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -605,7 +605,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_functiondef(node) - def test_ignores_google_redundant_return_doc_multiple_returns(self): + def test_ignores_google_redundant_return_doc_multiple_returns(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -622,7 +622,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_functiondef(node) - def test_ignores_numpy_redundant_return_doc_multiple_returns(self): + def test_ignores_numpy_redundant_return_doc_multiple_returns(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -643,7 +643,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_functiondef(node) - def test_ignore_sphinx_redundant_return_doc_yield(self): + def test_ignore_sphinx_redundant_return_doc_yield(self) -> None: node = astroid.extract_node( ''' def my_func_with_yield(self): @@ -659,7 +659,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): with self.assertNoMessages(): self.checker.visit_functiondef(node) - def test_warns_google_redundant_return_doc_yield(self): + def test_warns_google_redundant_return_doc_yield(self) -> None: node = astroid.extract_node( ''' def my_func(self): @@ -676,7 +676,7 @@ class TestDocstringCheckerReturn(CheckerTestCase): ): self.checker.visit_functiondef(node) - def test_warns_numpy_redundant_return_doc_yield(self): + def test_warns_numpy_redundant_return_doc_yield(self) -> None: node = astroid.extract_node( ''' def my_func(self): |