Skip to content

Move some of the Numpy tests out of TestParamDocChecker #5492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions tests/extensions/test_check_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
in particular the parameter documentation checker `DocstringChecker`
"""

# pylint: disable=too-many-public-methods
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌


import re

Expand Down Expand Up @@ -169,31 +168,6 @@ def my_func(arg, *, kwonly, missing_kwonly):
):
self.checker.visit_functiondef(node)

def test_finds_kwargs_without_type_numpy(self) -> None:
node = astroid.extract_node(
'''
def my_func(named_arg, **kwargs):
"""The docstring

Args
----
named_arg : object
Returned
**kwargs :
Keyword arguments

Returns
-------
object or None
Maybe named_arg
"""
if kwargs:
return named_arg
'''
)
with self.assertNoMessages():
self.checker.visit_functiondef(node)

COMPLEX_TYPES = [
"dict(str,str)",
"dict[str,str]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,22 @@ def test_finds_args_with_xref_type_numpy(named_arg, *args):
"""
if args:
return named_arg


def test_finds_kwargs_without_type_numpy(named_arg, **kwargs):
"""The docstring

Args
----
named_arg : object
Returned
**kwargs :
Keyword arguments

Returns
-------
object or None
Maybe named_arg
"""
if kwargs:
return named_arg