Skip to content

Commit 6a12b87

Browse files
committed
DOC: Add tests for extra linebreaks in docstrings.
1 parent a73ab81 commit 6a12b87

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

scripts/tests/test_validate_docstrings.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,34 @@ def astype3(self, dtype):
288288
"""
289289
pass
290290

291+
def two_linebreaks_between_sections(self, foo):
292+
"""
293+
Test linebreaks message GL03.
294+
295+
Note 2 blank lines before parameters section.
296+
297+
298+
Parameters
299+
----------
300+
foo : str
301+
Description of foo parameter.
302+
"""
303+
pass
304+
305+
def linebreak_at_end_of_docstring(self, foo):
306+
"""
307+
Test linebreaks message GL03.
308+
309+
Note extra blank line at end of docstring.
310+
311+
Parameters
312+
----------
313+
foo : str
314+
Description of foo parameter.
315+
316+
"""
317+
pass
318+
291319
def plot(self, kind, **kwargs):
292320
"""
293321
Generate a plot.
@@ -694,7 +722,9 @@ def test_bad_class(self):
694722
@capture_stderr
695723
@pytest.mark.parametrize("func", [
696724
'func', 'astype', 'astype1', 'astype2', 'astype3', 'plot', 'method',
697-
'private_classes'])
725+
'private_classes',
726+
'two_linebreaks_between_sections', 'linebreak_at_end_of_docstring',
727+
])
698728
def test_bad_generic_functions(self, func):
699729
errors = validate_one(self._import_path( # noqa:F821
700730
klass='BadGenericDocStrings', func=func))['errors']

0 commit comments

Comments
 (0)