From eb802b1a2cf9a4c49f61309718e2fba1ed932a08 Mon Sep 17 00:00:00 2001 From: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com> Date: Thu, 21 Oct 2021 20:08:12 -0400 Subject: [PATCH 1/2] Add Warnings to validate tests --- numpydoc/tests/test_validate.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/numpydoc/tests/test_validate.py b/numpydoc/tests/test_validate.py index 704a25ef..10f95e4f 100644 --- a/numpydoc/tests/test_validate.py +++ b/numpydoc/tests/test_validate.py @@ -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. @@ -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): From 3fbd0d401d180ade7b75f23613ea4938589650fc Mon Sep 17 00:00:00 2001 From: Matthew Flamm Date: Thu, 21 Oct 2021 21:11:36 -0400 Subject: [PATCH 2/2] Add Warnings to allowed sections. --- numpydoc/validate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/numpydoc/validate.py b/numpydoc/validate.py index b33ea780..3c8d60ec 100644 --- a/numpydoc/validate.py +++ b/numpydoc/validate.py @@ -27,6 +27,7 @@ "Other Parameters", "Raises", "Warns", + "Warnings", "See Also", "Notes", "References",