Make sure we suspend capturing if errors occur during readouterr
(pytester: Pytester)
| 827 | |
| 828 | |
| 829 | def test_error_during_readouterr(pytester: Pytester) -> None: |
| 830 | """Make sure we suspend capturing if errors occur during readouterr""" |
| 831 | pytester.makepyfile( |
| 832 | pytest_xyz=""" |
| 833 | from _pytest.capture import FDCapture |
| 834 | |
| 835 | def bad_snap(self): |
| 836 | raise Exception('boom') |
| 837 | |
| 838 | assert FDCapture.snap |
| 839 | FDCapture.snap = bad_snap |
| 840 | """ |
| 841 | ) |
| 842 | result = pytester.runpytest_subprocess("-p", "pytest_xyz", "--version") |
| 843 | result.stderr.fnmatch_lines( |
| 844 | ["*in bad_snap", " raise Exception('boom')", "Exception: boom"] |
| 845 | ) |
| 846 | |
| 847 | |
| 848 | class TestCaptureIO: |
nothing calls this directly
no test coverage detected