(self, pytester: Pytester)
| 180 | result.stdout.fnmatch_lines(["*1 passed*"]) |
| 181 | |
| 182 | def test_doctest_unexpected_exception(self, pytester: Pytester): |
| 183 | pytester.maketxtfile( |
| 184 | """ |
| 185 | >>> i = 0 |
| 186 | >>> 0 / i |
| 187 | 2 |
| 188 | """ |
| 189 | ) |
| 190 | result = pytester.runpytest("--doctest-modules") |
| 191 | result.stdout.fnmatch_lines( |
| 192 | [ |
| 193 | "test_doctest_unexpected_exception.txt F *", |
| 194 | "", |
| 195 | "*= FAILURES =*", |
| 196 | "*_ [[]doctest[]] test_doctest_unexpected_exception.txt _*", |
| 197 | "001 >>> i = 0", |
| 198 | "002 >>> 0 / i", |
| 199 | "UNEXPECTED EXCEPTION: ZeroDivisionError*", |
| 200 | "Traceback (most recent call last):", |
| 201 | ' File "*/doctest.py", line *, in __run', |
| 202 | " *", |
| 203 | ' File "<doctest test_doctest_unexpected_exception.txt[1]>", line 1, in <module>', |
| 204 | "ZeroDivisionError: division by zero", |
| 205 | "*/test_doctest_unexpected_exception.txt:2: UnexpectedException", |
| 206 | ], |
| 207 | consecutive=True, |
| 208 | ) |
| 209 | |
| 210 | def test_doctest_outcomes(self, pytester: Pytester): |
| 211 | pytester.maketxtfile( |
nothing calls this directly
no test coverage detected