@@ -334,33 +334,6 @@ def method(self, foo=None, bar=None):
334334 pass
335335
336336
337- class BadSeeAlso (object ):
338-
339- def desc_no_period (self ):
340- """
341- Return the first 5 elements of the Series.
342-
343- See Also
344- --------
345- Series.tail : Return the last 5 elements of the Series.
346- Series.iloc : Return a slice of the elements in the Series,
347- which can also be used to return the first or last n
348- """
349- pass
350-
351- def desc_first_letter_lowercase (self ):
352- """
353- Return the first 5 elements of the Series.
354-
355- See Also
356- --------
357- Series.tail : return the last 5 elements of the Series.
358- Series.iloc : Return a slice of the elements in the Series,
359- which can also be used to return the first or last n.
360- """
361- pass
362-
363-
364337class BadSummaries (object ):
365338
366339 def wrong_line (self ):
@@ -573,6 +546,44 @@ def no_punctuation(self):
573546 return "Hello world!"
574547
575548
549+ class BadSeeAlso (object ):
550+
551+ def desc_no_period (self ):
552+ """
553+ Return the first 5 elements of the Series.
554+
555+ See Also
556+ --------
557+ Series.tail : Return the last 5 elements of the Series.
558+ Series.iloc : Return a slice of the elements in the Series,
559+ which can also be used to return the first or last n
560+ """
561+ pass
562+
563+ def desc_first_letter_lowercase (self ):
564+ """
565+ Return the first 5 elements of the Series.
566+
567+ See Also
568+ --------
569+ Series.tail : return the last 5 elements of the Series.
570+ Series.iloc : Return a slice of the elements in the Series,
571+ which can also be used to return the first or last n.
572+ """
573+ pass
574+
575+ def prefix_pandas (self ):
576+ """
577+ Have `pandas` prefix in See Also section.
578+
579+ See Also
580+ --------
581+ pandas.Series.rename : Alter Series index labels or name.
582+ DataFrame.head : The first `n` rows of the caller object.
583+ """
584+ pass
585+
586+
576587class TestValidator (object ):
577588
578589 def _import_path (self , klass = None , func = None ):
@@ -688,7 +699,11 @@ def test_bad_generic_functions(self, func):
688699 pytest .param ('BadReturns' , 'no_description' , ('foo' ,),
689700 marks = pytest .mark .xfail ),
690701 pytest .param ('BadReturns' , 'no_punctuation' , ('foo' ,),
691- marks = pytest .mark .xfail )
702+ marks = pytest .mark .xfail ),
703+ # See Also tests
704+ ('BadSeeAlso' , 'prefix_pandas' ,
705+ ('pandas.Series.rename in `See Also` section '
706+ 'does not need `pandas` prefix' ,))
692707 ])
693708 def test_bad_examples (self , capsys , klass , func , msgs ):
694709 result = validate_one (self ._import_path (klass = klass , func = func )) # noqa:F821
0 commit comments