@@ -633,6 +633,43 @@ def no_punctuation(self):
633
633
"""
634
634
return "Hello world!"
635
635
636
+ def named_single_return (self ):
637
+ """
638
+ Provides name but returns only one value.
639
+
640
+ Returns
641
+ -------
642
+ s : str
643
+ A nice greeting.
644
+ """
645
+ return "Hello world!"
646
+
647
+ def no_capitalization (self ):
648
+ """
649
+ Forgets capitalization in return values description.
650
+
651
+ Returns
652
+ -------
653
+ foo : str
654
+ The first returned string.
655
+ bar : str
656
+ the second returned string.
657
+ """
658
+ return "Hello" , "World!"
659
+
660
+ def no_period_multi (self ):
661
+ """
662
+ Forgets period in return values description.
663
+
664
+ Returns
665
+ -------
666
+ foo : str
667
+ The first returned string
668
+ bar : str
669
+ The second returned string.
670
+ """
671
+ return "Hello" , "World!"
672
+
636
673
637
674
class BadSeeAlso (object ):
638
675
@@ -829,10 +866,18 @@ def test_bad_generic_functions(self, capsys, func):
829
866
('BadReturns' , 'yield_not_documented' , ('No Yields section found' ,)),
830
867
pytest .param ('BadReturns' , 'no_type' , ('foo' ,),
831
868
marks = pytest .mark .xfail ),
832
- pytest .param ('BadReturns' , 'no_description' , ('foo' ,),
833
- marks = pytest .mark .xfail ),
834
- pytest .param ('BadReturns' , 'no_punctuation' , ('foo' ,),
835
- marks = pytest .mark .xfail ),
869
+ ('BadReturns' , 'no_description' ,
870
+ ('Return value has no description' ,)),
871
+ ('BadReturns' , 'no_punctuation' ,
872
+ ('Return value description should finish with "."' ,)),
873
+ ('BadReturns' , 'named_single_return' ,
874
+ ('The first line of the Returns section should contain only the '
875
+ 'type, unless multiple values are being returned' ,)),
876
+ ('BadReturns' , 'no_capitalization' ,
877
+ ('Return value description should start with a capital '
878
+ 'letter' ,)),
879
+ ('BadReturns' , 'no_period_multi' ,
880
+ ('Return value description should finish with "."' ,)),
836
881
# Examples tests
837
882
('BadGenericDocStrings' , 'method' ,
838
883
('Do not import numpy, as it is imported automatically' ,)),
0 commit comments