Show More
@@ -27,6 +27,7 b' from nose import SkipTest' | |||
|
27 | 27 | |
|
28 | 28 | from IPython.testing import decorators as dec |
|
29 | 29 | from IPython.testing.ipunittest import ParametricTestCase |
|
30 | from IPython.utils.io import capture_output | |
|
30 | 31 | |
|
31 | 32 | from IPython import parallel as pmod |
|
32 | 33 | from IPython.parallel import error |
@@ -578,6 +579,30 b' class TestView(ClusterTestCase, ParametricTestCase):' | |||
|
578 | 579 | ar = view.execute("1/0") |
|
579 | 580 | self.assertRaisesRemote(ZeroDivisionError, ar.get, 2) |
|
580 | 581 | |
|
582 | def test_remoteerror_render_exception(self): | |
|
583 | """RemoteErrors get nice tracebacks""" | |
|
584 | view = self.client[-1] | |
|
585 | ar = view.execute("1/0") | |
|
586 | ip = get_ipython() | |
|
587 | ip.user_ns['ar'] = ar | |
|
588 | with capture_output() as io: | |
|
589 | ip.run_cell("ar.get(2)") | |
|
590 | ||
|
591 | self.assertTrue('ZeroDivisionError' in io.stdout, io.stdout) | |
|
592 | ||
|
593 | def test_compositeerror_render_exception(self): | |
|
594 | """CompositeErrors get nice tracebacks""" | |
|
595 | view = self.client[:] | |
|
596 | ar = view.execute("1/0") | |
|
597 | ip = get_ipython() | |
|
598 | ip.user_ns['ar'] = ar | |
|
599 | with capture_output() as io: | |
|
600 | ip.run_cell("ar.get(2)") | |
|
601 | ||
|
602 | self.assertEqual(io.stdout.count('ZeroDivisionError'), len(view) * 2, io.stdout) | |
|
603 | self.assertEqual(io.stdout.count('integer division'), len(view), io.stdout) | |
|
604 | self.assertEqual(io.stdout.count(':execute'), len(view), io.stdout) | |
|
605 | ||
|
581 | 606 | @dec.skipif_not_matplotlib |
|
582 | 607 | def test_magic_pylab(self): |
|
583 | 608 | """%pylab works on engines""" |
General Comments 0
You need to be logged in to leave comments.
Login now