@@ -668,6 +668,12 @@ def missing_whitespace_after_comma(self):
668
668
pass
669
669
670
670
671
+ class NoDocstrings (object ):
672
+
673
+ def method_wo_docstrings (self ):
674
+ pass
675
+
676
+
671
677
class TestValidator (object ):
672
678
673
679
def _import_path (self , klass = None , func = None ):
@@ -720,6 +726,13 @@ def test_bad_class(self):
720
726
assert isinstance (errors , list )
721
727
assert errors
722
728
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
+
723
736
@capture_stderr
724
737
@pytest .mark .parametrize ("func" , [
725
738
'func' , 'astype' , 'astype1' , 'astype2' , 'astype3' , 'plot' , 'method' ,
@@ -812,6 +825,8 @@ def test_bad_generic_functions(self, func):
812
825
'E226 missing whitespace around arithmetic operator' ,)),
813
826
('BadExamples' , 'missing_whitespace_after_comma' ,
814
827
("flake8 error: E231 missing whitespace after ',' (3 times)" ,)),
828
+ ('NoDocstrings' , 'method_wo_docstrings' ,
829
+ ("" ))
815
830
])
816
831
def test_bad_examples (self , capsys , klass , func , msgs ):
817
832
result = validate_one (self ._import_path (klass = klass , func = func ))
0 commit comments