Check that InteractiveShell is protected from bad custom exception handlers
(self)
| 214 | self.assertEqual(ip.user_ns["b"], 22) |
| 215 | |
| 216 | def test_bad_custom_tb(self): |
| 217 | """Check that InteractiveShell is protected from bad custom exception handlers""" |
| 218 | ip.set_custom_exc((IOError,), lambda etype, value, tb: 1 / 0) |
| 219 | self.assertEqual(ip.custom_exceptions, (IOError,)) |
| 220 | with tt.AssertPrints("Custom TB Handler failed", channel="stderr"): |
| 221 | ip.run_cell('raise IOError("foo")') |
| 222 | self.assertEqual(ip.custom_exceptions, ()) |
| 223 | |
| 224 | def test_bad_custom_tb_return(self): |
| 225 | """Check that InteractiveShell is protected from bad return types in custom exception handlers""" |
nothing calls this directly
no test coverage detected