Tests that a local translator works and that the local translator from the cross module is not applied
(msg)
| 276 | |
| 277 | |
| 278 | def test_local_translator(msg): |
| 279 | """Tests that a local translator works and that the local translator from |
| 280 | the cross module is not applied""" |
| 281 | with pytest.raises(RuntimeError) as excinfo: |
| 282 | m.throws6() |
| 283 | assert msg(excinfo.value) == "MyException6 only handled in this module" |
| 284 | |
| 285 | with pytest.raises(RuntimeError) as excinfo: |
| 286 | m.throws_local_error() |
| 287 | assert not isinstance(excinfo.value, KeyError) |
| 288 | assert msg(excinfo.value) == "never caught" |
| 289 | |
| 290 | with pytest.raises(Exception) as excinfo: |
| 291 | m.throws_local_simple_error() |
| 292 | assert not isinstance(excinfo.value, cm.LocalSimpleException) |
| 293 | assert msg(excinfo.value) == "this mod" |
| 294 | |
| 295 | |
| 296 | def test_error_already_set_message_with_unicode_surrogate(): # Issue #4288 |
nothing calls this directly
no test coverage detected