|
4 | 4 | import textwrap |
5 | 5 | import pytest |
6 | 6 | import numpy as np |
7 | | -from pandas.util.testing import capture_stderr |
8 | 7 | import validate_docstrings |
9 | 8 | validate_one = validate_docstrings.validate_one |
10 | 9 |
|
@@ -739,36 +738,32 @@ def _import_path(self, klass=None, func=None): |
739 | 738 |
|
740 | 739 | return base_path |
741 | 740 |
|
742 | | - @capture_stderr |
743 | | - def test_good_class(self): |
| 741 | + def test_good_class(self, capsys): |
744 | 742 | errors = validate_one(self._import_path( |
745 | 743 | klass='GoodDocStrings'))['errors'] |
746 | 744 | assert isinstance(errors, list) |
747 | 745 | assert not errors |
748 | 746 |
|
749 | | - @capture_stderr |
750 | 747 | @pytest.mark.parametrize("func", [ |
751 | 748 | 'plot', 'sample', 'random_letters', 'sample_values', 'head', 'head1', |
752 | 749 | 'contains', 'mode', 'good_imports']) |
753 | | - def test_good_functions(self, func): |
| 750 | + def test_good_functions(self, capsys, func): |
754 | 751 | errors = validate_one(self._import_path( |
755 | 752 | klass='GoodDocStrings', func=func))['errors'] |
756 | 753 | assert isinstance(errors, list) |
757 | 754 | assert not errors |
758 | 755 |
|
759 | | - @capture_stderr |
760 | | - def test_bad_class(self): |
| 756 | + def test_bad_class(self, capsys): |
761 | 757 | errors = validate_one(self._import_path( |
762 | 758 | klass='BadGenericDocStrings'))['errors'] |
763 | 759 | assert isinstance(errors, list) |
764 | 760 | assert errors |
765 | 761 |
|
766 | | - @capture_stderr |
767 | 762 | @pytest.mark.parametrize("func", [ |
768 | 763 | 'func', 'astype', 'astype1', 'astype2', 'astype3', 'plot', 'method', |
769 | 764 | 'private_classes', |
770 | 765 | ]) |
771 | | - def test_bad_generic_functions(self, func): |
| 766 | + def test_bad_generic_functions(self, capsys, func): |
772 | 767 | errors = validate_one(self._import_path( # noqa:F821 |
773 | 768 | klass='BadGenericDocStrings', func=func))['errors'] |
774 | 769 | assert isinstance(errors, list) |
|
0 commit comments