Skip to content

Fix Warnings section in validate #335

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 2 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 22 additions & 0 deletions numpydoc/tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,27 @@ def say_hello():
else:
return None

def warnings(self):
"""
Do one thing.

Sometimes, this function does other things.

Warnings
--------
This function may produce side effects when some condition
is met.

See Also
--------
related : Something related.

Examples
--------
>>> result = 1 + 1
"""
pass

def multiple_variables_on_one_line(self, matrix, a, b, i, j):
"""
Swap two values in a matrix.
Expand Down Expand Up @@ -1039,6 +1060,7 @@ def test_good_class(self, capsys):
"no_returns",
"empty_returns",
"multiple_variables_on_one_line",
"warnings",
],
)
def test_good_functions(self, capsys, func):
Expand Down
1 change: 1 addition & 0 deletions numpydoc/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"Other Parameters",
"Raises",
"Warns",
"Warnings",
"See Also",
"Notes",
"References",
Expand Down