(self, pytester: Pytester)
| 205 | result.stdout.fnmatch_lines(["*1 passed*"]) |
| 206 | |
| 207 | def test_doctest_unexpected_exception(self, pytester: Pytester): |
| 208 | pytester.maketxtfile( |
| 209 | """ |
| 210 | >>> i = 0 |
| 211 | >>> 0 / i |
| 212 | 2 |
| 213 | """ |
| 214 | ) |
| 215 | result = pytester.runpytest("--doctest-modules") |
| 216 | result.stdout.fnmatch_lines( |
| 217 | [ |
| 218 | "test_doctest_unexpected_exception.txt F *", |
| 219 | "", |
| 220 | "*= FAILURES =*", |
| 221 | "*_ [[]doctest[]] test_doctest_unexpected_exception.txt _*", |
| 222 | "001 >>> i = 0", |
| 223 | "002 >>> 0 / i", |
| 224 | "UNEXPECTED EXCEPTION: ZeroDivisionError*", |
| 225 | "Traceback (most recent call last):", |
| 226 | *( |
| 227 | (' File "*/doctest.py", line *, in __run', " *") |
| 228 | if sys.version_info <= (3, 14) |
| 229 | else () |
| 230 | ), |
| 231 | *((" *^^^^*", " *", " *") if sys.version_info[:2] == (3, 13) else ()), |
| 232 | ' File "<doctest test_doctest_unexpected_exception.txt[1]>", line 1, in <module>', |
| 233 | "ZeroDivisionError: division by zero", |
| 234 | "*/test_doctest_unexpected_exception.txt:2: UnexpectedException", |
| 235 | ], |
| 236 | consecutive=True, |
| 237 | ) |
| 238 | |
| 239 | def test_doctest_outcomes(self, pytester: Pytester): |
| 240 | pytester.maketxtfile( |
nothing calls this directly
no test coverage detected