@@ -545,6 +545,30 @@ def no_punctuation(self):
545
545
"""
546
546
return "Hello world!"
547
547
548
+ def named_single_return (self ):
549
+ """
550
+ Provides name but returns only one value.
551
+
552
+ Returns
553
+ -------
554
+ s : str
555
+ A nice greeting.
556
+ """
557
+ return "Hello world!"
558
+
559
+ def no_capitalization (self ):
560
+ """
561
+ Forgets capitalization in return values descriptions.
562
+
563
+ Returns
564
+ -------
565
+ foo : str
566
+ the first returned string.
567
+ bar : str
568
+ the second returned string.
569
+ """
570
+ return "Hello" , "World!"
571
+
548
572
549
573
class BadSeeAlso (object ):
550
574
@@ -696,10 +720,18 @@ def test_bad_generic_functions(self, func):
696
720
('BadReturns' , 'yield_not_documented' , ('No Yields section found' ,)),
697
721
pytest .param ('BadReturns' , 'no_type' , ('foo' ,),
698
722
marks = pytest .mark .xfail ),
699
- pytest .param ('BadReturns' , 'no_description' , ('foo' ,),
700
- marks = pytest .mark .xfail ),
701
- pytest .param ('BadReturns' , 'no_punctuation' , ('foo' ,),
702
- marks = pytest .mark .xfail ),
723
+ ('BadReturns' , 'no_description' ,
724
+ ('Return value has no description' ,)),
725
+ ('BadReturns' , 'no_punctuation' ,
726
+ ('Return value description should finish with "."' ,)),
727
+ ('BadReturns' , 'named_single_return' ,
728
+ ('No name is to be provided when returning a single value' ,)),
729
+ ('BadReturns' , 'no_capitalization' ,
730
+ ('Return value "foo" description should start with a capital '
731
+ 'letter' ,)),
732
+ ('BadReturns' , 'no_capitalization' ,
733
+ ('Return value "bar" description should start with a capital '
734
+ 'letter' ,)),
703
735
# See Also tests
704
736
('BadSeeAlso' , 'prefix_pandas' ,
705
737
('pandas.Series.rename in `See Also` section '
0 commit comments