##// END OF EJS Templates
Add more tests
Quentin Peter -
Show More
@@ -296,12 +296,25 b' except Exception:'
296 tt.AssertPrints("ValueError", suppress=False):
296 tt.AssertPrints("ValueError", suppress=False):
297 ip.run_cell(self.SUPPRESS_CHAINING_CODE)
297 ip.run_cell(self.SUPPRESS_CHAINING_CODE)
298
298
299 def test_plain_exception(self):
299 def test_plain_direct_cause_error(self):
300 with tt.AssertPrints(["KeyError", "NameError", "direct cause"]):
301 ip.run_cell("%xmode Plain")
302 ip.run_cell(self.DIRECT_CAUSE_ERROR_CODE)
303 ip.run_cell("%xmode Verbose")
304
305 def test_plain_exception_during_handling_error(self):
300 with tt.AssertPrints(["KeyError", "NameError", "During handling"]):
306 with tt.AssertPrints(["KeyError", "NameError", "During handling"]):
301 ip.run_cell("%xmode Plain")
307 ip.run_cell("%xmode Plain")
302 ip.run_cell(self.EXCEPTION_DURING_HANDLING_CODE)
308 ip.run_cell(self.EXCEPTION_DURING_HANDLING_CODE)
303 ip.run_cell("%xmode Verbose")
309 ip.run_cell("%xmode Verbose")
304
310
311 def test_plain_suppress_exception_chaining(self):
312 with tt.AssertNotPrints("ZeroDivisionError"), \
313 tt.AssertPrints("ValueError", suppress=False):
314 ip.run_cell("%xmode Plain")
315 ip.run_cell(self.SUPPRESS_CHAINING_CODE)
316 ip.run_cell("%xmode Verbose")
317
305
318
306 class RecursionTest(unittest.TestCase):
319 class RecursionTest(unittest.TestCase):
307 DEFINITIONS = """
320 DEFINITIONS = """
General Comments 0
You need to be logged in to leave comments. Login now