()
| 239 | |
| 240 | |
| 241 | def test_error_method(): |
| 242 | f = HTMLFormatter() |
| 243 | class BadHTML(object): |
| 244 | def _repr_html_(self): |
| 245 | raise ValueError("Bad HTML") |
| 246 | bad = BadHTML() |
| 247 | with capture_output() as captured: |
| 248 | result = f(bad) |
| 249 | nt.assert_is(result, None) |
| 250 | nt.assert_in("Traceback", captured.stdout) |
| 251 | nt.assert_in("Bad HTML", captured.stdout) |
| 252 | nt.assert_in("_repr_html_", captured.stdout) |
| 253 | |
| 254 | def test_nowarn_notimplemented(): |
| 255 | f = HTMLFormatter() |
nothing calls this directly
no test coverage detected