Don't crash trying to highlight empty source code. Issue #11758.
()
| 312 | |
| 313 | |
| 314 | def test_highlight_empty_source() -> None: |
| 315 | """Don't crash trying to highlight empty source code. |
| 316 | |
| 317 | Issue #11758. |
| 318 | """ |
| 319 | f = io.StringIO() |
| 320 | tw = terminalwriter.TerminalWriter(f) |
| 321 | tw.hasmarkup = True |
| 322 | tw.code_highlight = True |
| 323 | tw._write_source([]) |
| 324 | |
| 325 | assert f.getvalue() == "" |
nothing calls this directly
no test coverage detected