()
| 274 | nt.assert_in("name_error", captured.stdout) |
| 275 | |
| 276 | def test_error_pretty_method(): |
| 277 | f = PlainTextFormatter() |
| 278 | class BadPretty(object): |
| 279 | def _repr_pretty_(self): |
| 280 | return "hello" |
| 281 | bad = BadPretty() |
| 282 | with capture_output() as captured: |
| 283 | result = f(bad) |
| 284 | nt.assert_is(result, None) |
| 285 | nt.assert_in("Traceback", captured.stdout) |
| 286 | nt.assert_in("_repr_pretty_", captured.stdout) |
| 287 | nt.assert_in("given", captured.stdout) |
| 288 | nt.assert_in("argument", captured.stdout) |
| 289 | |
| 290 | |
| 291 | def test_bad_repr_traceback(): |
nothing calls this directly
no test coverage detected