Skip to content

Commit be70dd9

Browse files
authored
Fix Warnings section in validate (#335)
* Add Warnings to validate tests * Add Warnings to allowed sections.
1 parent d85f54e commit be70dd9

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

numpydoc/tests/test_validate.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,27 @@ def say_hello():
384384
else:
385385
return None
386386

387+
def warnings(self):
388+
"""
389+
Do one thing.
390+
391+
Sometimes, this function does other things.
392+
393+
Warnings
394+
--------
395+
This function may produce side effects when some condition
396+
is met.
397+
398+
See Also
399+
--------
400+
related : Something related.
401+
402+
Examples
403+
--------
404+
>>> result = 1 + 1
405+
"""
406+
pass
407+
387408
def multiple_variables_on_one_line(self, matrix, a, b, i, j):
388409
"""
389410
Swap two values in a matrix.
@@ -1039,6 +1060,7 @@ def test_good_class(self, capsys):
10391060
"no_returns",
10401061
"empty_returns",
10411062
"multiple_variables_on_one_line",
1063+
"warnings",
10421064
],
10431065
)
10441066
def test_good_functions(self, capsys, func):

numpydoc/validate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"Other Parameters",
2828
"Raises",
2929
"Warns",
30+
"Warnings",
3031
"See Also",
3132
"Notes",
3233
"References",

0 commit comments

Comments
 (0)