##// END OF EJS Templates
test %pylab on engines...
MinRK -
Show More
@@ -448,6 +448,7 b' class TestView(ClusterTestCase, ParametricTestCase):'
448 448 ip.magic_autopx()
449 449 ip.run_cell('\n'.join(('a=5','b=10','c=0')))
450 450 ip.run_cell('print (b)')
451 ip.run_cell('import time; time.sleep(0.1)')
451 452 ip.run_cell("b/c")
452 453 ip.run_cell('b*=2')
453 454 ip.magic_autopx()
@@ -457,9 +458,12 b' class TestView(ClusterTestCase, ParametricTestCase):'
457 458 self.assertTrue(output.endswith('%autopx disabled'))
458 459 self.assertFalse('ZeroDivisionError' in output)
459 460 ar = v.get_result(-2)
460 self.assertEquals(v['a'], 5)
461 self.assertEquals(v['b'], 20)
462 461 self.assertRaisesRemote(ZeroDivisionError, ar.get)
462 # prevent TaskAborted on pulls, due to ZeroDivisionError
463 time.sleep(0.5)
464 self.assertEquals(v['a'], 5)
465 # b*=2 will not fire, due to abort
466 self.assertEquals(v['b'], 10)
463 467
464 468 def test_magic_result(self):
465 469 ip = get_ipython()
@@ -655,3 +659,18 b' class TestView(ClusterTestCase, ParametricTestCase):'
655 659 ar = view.execute("1/0")
656 660 self.assertRaisesRemote(ZeroDivisionError, ar.get, 2)
657 661
662 @dec.skipif_not_matplotlib
663 def test_amagic_pylab(self):
664 """%pylab works on engines"""
665 view = self.client[-1]
666 ar = view.execute("%pylab inline")
667 # at least check if this raised:
668 reply = ar.get(5)
669 # include imports, in case user config
670 ar = view.execute("plot(rand(100))", silent=False)
671 reply = ar.get(5)
672 self.assertEquals(len(reply.outputs), 1)
673 output = reply.outputs[0]
674 self.assertTrue("image/png" in output)
675
676
General Comments 0
You need to be logged in to leave comments. Login now