Skip to content

Commit db782fd

Browse files
Addressing comments from review
1 parent 1d2c5c0 commit db782fd

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

scripts/tests/test_validate_docstrings.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ def test_bad_examples(self, capsys, klass, func, msgs):
608608
assert msg in ' '.join(result['errors'])
609609

610610

611-
class TestApiItems(object):
611+
class ApiItems(object):
612612
@property
613613
def api_doc(self):
614614
return io.StringIO('''
@@ -652,33 +652,33 @@ def api_doc(self):
652652
(3, 'random.seed'),
653653
(4, 'random.randint')])
654654
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
657657

658658
@pytest.mark.parametrize('idx,func', [(0, 'cycle'),
659659
(1, 'count'),
660660
(2, 'chain'),
661661
(3, 'seed'),
662662
(4, 'randint')])
663663
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
667667

668668
@pytest.mark.parametrize('idx,section', [(0, 'Itertools'),
669669
(1, 'Itertools'),
670670
(2, 'Itertools'),
671671
(3, 'Random'),
672672
(4, 'Random')])
673673
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
676676

677677
@pytest.mark.parametrize('idx,subsection', [(0, 'Infinite'),
678678
(1, 'Infinite'),
679679
(2, 'Finite'),
680680
(3, 'All'),
681681
(4, 'All')])
682682
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

scripts/validate_docstrings.py

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747

4848
def get_api_items(api_doc_fd):
4949
"""
50+
Yield information about all public API items.
51+
5052
Parse api.rst file from the documentation, and extract all the functions,
5153
methods, classes, attributes... This should include all pandas public API.
5254

0 commit comments

Comments
 (0)