##// END OF EJS Templates
update %px tests with recent changes
MinRK -
Show More
@@ -370,14 +370,14 b' class TestView(ClusterTestCase, ParametricTestCase):'
370
370
371 def test_magic_px_blocking(self):
371 def test_magic_px_blocking(self):
372 ip = get_ipython()
372 ip = get_ipython()
373 v = self.client[-1]
373 v = self.client[-1:]
374 v.activate()
374 v.activate()
375 v.block=True
375 v.block=True
376
376
377 ip.magic('px a=5')
377 ip.magic('px a=5')
378 self.assertEquals(v['a'], 5)
378 self.assertEquals(v['a'], [5])
379 ip.magic('px a=10')
379 ip.magic('px a=10')
380 self.assertEquals(v['a'], 10)
380 self.assertEquals(v['a'], [10])
381 sio = StringIO()
381 sio = StringIO()
382 savestdout = sys.stdout
382 savestdout = sys.stdout
383 sys.stdout = sio
383 sys.stdout = sio
@@ -392,21 +392,21 b' class TestView(ClusterTestCase, ParametricTestCase):'
392
392
393 def test_magic_px_nonblocking(self):
393 def test_magic_px_nonblocking(self):
394 ip = get_ipython()
394 ip = get_ipython()
395 v = self.client[-1]
395 v = self.client[-1:]
396 v.activate()
396 v.activate()
397 v.block=False
397 v.block=False
398
398
399 ip.magic('px a=5')
399 ip.magic('px a=5')
400 self.assertEquals(v['a'], 5)
400 self.assertEquals(v['a'], [5])
401 ip.magic('px a=10')
401 ip.magic('px a=10')
402 self.assertEquals(v['a'], 10)
402 self.assertEquals(v['a'], [10])
403 sio = StringIO()
403 sio = StringIO()
404 savestdout = sys.stdout
404 savestdout = sys.stdout
405 sys.stdout = sio
405 sys.stdout = sio
406 ip.magic('px print a')
406 ip.magic('px print a')
407 sys.stdout = savestdout
407 sys.stdout = savestdout
408 buf = sio.getvalue()
408 buf = sio.getvalue()
409 self.assertFalse('[stdout:%i]'%v.targets in buf)
409 self.assertFalse('[stdout:' in buf)
410 ip.magic('px 1/0')
410 ip.magic('px 1/0')
411 ar = v.get_result(-1)
411 ar = v.get_result(-1)
412 self.assertRaisesRemote(ZeroDivisionError, ar.get)
412 self.assertRaisesRemote(ZeroDivisionError, ar.get)
General Comments 0
You need to be logged in to leave comments. Login now