Skip to content

Commit 50e85bf

Browse files
author
Alex Volkov
committed
Adding tests for no docstrings error.
1 parent bba8b4d commit 50e85bf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts/tests/test_validate_docstrings.py

+15
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,12 @@ def missing_whitespace_after_comma(self):
668668
pass
669669

670670

671+
class NoDocstrings(object):
672+
673+
def method_wo_docstrings(self):
674+
pass
675+
676+
671677
class TestValidator(object):
672678

673679
def _import_path(self, klass=None, func=None):
@@ -720,6 +726,13 @@ def test_bad_class(self):
720726
assert isinstance(errors, list)
721727
assert errors
722728

729+
@capture_stderr
730+
def test_bad_class(self):
731+
errors = validate_one(self._import_path(
732+
klass='NoDocstrings'))['errors']
733+
assert isinstance(errors, list)
734+
assert errors
735+
723736
@capture_stderr
724737
@pytest.mark.parametrize("func", [
725738
'func', 'astype', 'astype1', 'astype2', 'astype3', 'plot', 'method',
@@ -812,6 +825,8 @@ def test_bad_generic_functions(self, func):
812825
'E226 missing whitespace around arithmetic operator',)),
813826
('BadExamples', 'missing_whitespace_after_comma',
814827
("flake8 error: E231 missing whitespace after ',' (3 times)",)),
828+
('NoDocstrings', 'method_wo_docstrings',
829+
(""))
815830
])
816831
def test_bad_examples(self, capsys, klass, func, msgs):
817832
result = validate_one(self._import_path(klass=klass, func=func))

0 commit comments

Comments
 (0)