@@ -608,7 +608,7 @@ def test_bad_examples(self, capsys, klass, func, msgs):
608
608
assert msg in ' ' .join (result ['errors' ])
609
609
610
610
611
- class TestApiItems (object ):
611
+ class ApiItems (object ):
612
612
@property
613
613
def api_doc (self ):
614
614
return io .StringIO ('''
@@ -652,33 +652,33 @@ def api_doc(self):
652
652
(3 , 'random.seed' ),
653
653
(4 , 'random.randint' )])
654
654
def test_item_name (self , idx , name ):
655
- res = list (validate_docstrings .get_api_items (self .api_doc ))
656
- assert res [idx ][0 ] == name
655
+ result = list (validate_docstrings .get_api_items (self .api_doc ))
656
+ assert result [idx ][0 ] == name
657
657
658
658
@pytest .mark .parametrize ('idx,func' , [(0 , 'cycle' ),
659
659
(1 , 'count' ),
660
660
(2 , 'chain' ),
661
661
(3 , 'seed' ),
662
662
(4 , 'randint' )])
663
663
def test_item_function (self , idx , func ):
664
- res = list (validate_docstrings .get_api_items (self .api_doc ))
665
- assert callable (res [idx ][1 ])
666
- assert res [idx ][1 ].__name__ == func
664
+ result = list (validate_docstrings .get_api_items (self .api_doc ))
665
+ assert callable (result [idx ][1 ])
666
+ assert result [idx ][1 ].__name__ == func
667
667
668
668
@pytest .mark .parametrize ('idx,section' , [(0 , 'Itertools' ),
669
669
(1 , 'Itertools' ),
670
670
(2 , 'Itertools' ),
671
671
(3 , 'Random' ),
672
672
(4 , 'Random' )])
673
673
def test_item_section (self , idx , section ):
674
- res = list (validate_docstrings .get_api_items (self .api_doc ))
675
- assert res [idx ][2 ] == section
674
+ result = list (validate_docstrings .get_api_items (self .api_doc ))
675
+ assert result [idx ][2 ] == section
676
676
677
677
@pytest .mark .parametrize ('idx,subsection' , [(0 , 'Infinite' ),
678
678
(1 , 'Infinite' ),
679
679
(2 , 'Finite' ),
680
680
(3 , 'All' ),
681
681
(4 , 'All' )])
682
682
def test_item_subsection (self , idx , subsection ):
683
- res = list (validate_docstrings .get_api_items (self .api_doc ))
684
- assert res [idx ][3 ] == subsection
683
+ result = list (validate_docstrings .get_api_items (self .api_doc ))
684
+ assert result [idx ][3 ] == subsection
0 commit comments