Skip to content

Commit e727568

Browse files
committed
DOC: Move GL03 extra linebreak tests into test_bad_examples().
1 parent d91bed8 commit e727568

File tree

1 file changed

+36
-29
lines changed

1 file changed

+36
-29
lines changed

scripts/tests/test_validate_docstrings.py

+36-29
Original file line numberDiff line numberDiff line change
@@ -288,34 +288,6 @@ 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-
319291
def plot(self, kind, **kwargs):
320292
"""
321293
Generate a plot.
@@ -695,6 +667,34 @@ def missing_whitespace_after_comma(self):
695667
"""
696668
pass
697669

670+
def two_linebreaks_between_sections(self, foo):
671+
"""
672+
Test linebreaks message GL03.
673+
674+
Note 2 blank lines before parameters section.
675+
676+
677+
Parameters
678+
----------
679+
foo : str
680+
Description of foo parameter.
681+
"""
682+
pass
683+
684+
def linebreak_at_end_of_docstring(self, foo):
685+
"""
686+
Test linebreaks message GL03.
687+
688+
Note extra blank line at end of docstring.
689+
690+
Parameters
691+
----------
692+
foo : str
693+
Description of foo parameter.
694+
695+
"""
696+
pass
697+
698698

699699
class TestValidator(object):
700700

@@ -752,7 +752,6 @@ def test_bad_class(self):
752752
@pytest.mark.parametrize("func", [
753753
'func', 'astype', 'astype1', 'astype2', 'astype3', 'plot', 'method',
754754
'private_classes',
755-
'two_linebreaks_between_sections', 'linebreak_at_end_of_docstring',
756755
])
757756
def test_bad_generic_functions(self, func):
758757
errors = validate_one(self._import_path( # noqa:F821
@@ -841,6 +840,14 @@ def test_bad_generic_functions(self, func):
841840
'E226 missing whitespace around arithmetic operator',)),
842841
('BadExamples', 'missing_whitespace_after_comma',
843842
("flake8 error: E231 missing whitespace after ',' (3 times)",)),
843+
('BadExamples', 'two_linebreaks_between_sections',
844+
('Double line break found; please use only one blank line to '
845+
'separate sections or paragraphs, and do not leave blank lines '
846+
'at the end of docstrings',)),
847+
('BadExamples', 'linebreak_at_end_of_docstring',
848+
('Double line break found; please use only one blank line to '
849+
'separate sections or paragraphs, and do not leave blank lines '
850+
'at the end of docstrings',)),
844851
])
845852
def test_bad_examples(self, capsys, klass, func, msgs):
846853
result = validate_one(self._import_path(klass=klass, func=func))

0 commit comments

Comments
 (0)