()
| 295 | |
| 296 | |
| 297 | def test_error_method(): |
| 298 | f = HTMLFormatter() |
| 299 | |
| 300 | class BadHTML(object): |
| 301 | def _repr_html_(self): |
| 302 | raise ValueError("Bad HTML") |
| 303 | |
| 304 | bad = BadHTML() |
| 305 | with capture_output() as captured: |
| 306 | result = f(bad) |
| 307 | assert result is None |
| 308 | assert "Traceback" in captured.stdout |
| 309 | assert "Bad HTML" in captured.stdout |
| 310 | assert "_repr_html_" in captured.stdout |
| 311 | |
| 312 | |
| 313 | def test_nowarn_notimplemented(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…