##// END OF EJS Templates
test %%px --block / --targets
MinRK -
Show More
@@ -341,5 +341,37 b' class TestParallelMagics(ClusterTestCase, ParametricTestCase):'
341 self.assertEquals(v.block, True)
341 self.assertEquals(v.block, True)
342 ip.magic("%pxconfig_tst --noblock")
342 ip.magic("%pxconfig_tst --noblock")
343 self.assertEquals(v.block, False)
343 self.assertEquals(v.block, False)
344
344
345 def test_cellpx_targets(self):
346 """%%px --targets doesn't change defaults"""
347 ip = get_ipython()
348 rc = self.client
349 view = rc.activate(rc.ids)
350 self.assertEquals(view.targets, rc.ids)
351 for cell in ("pass", "1/0"):
352 with capture_output() as io:
353 try:
354 ip.run_cell_magic("px", "--targets all", cell)
355 except pmod.RemoteError:
356 pass
357 self.assertTrue('engine(s): all' in io.stdout)
358 self.assertEquals(view.targets, rc.ids)
359
360
361 def test_cellpx_block(self):
362 """%%px --block doesn't change default"""
363 ip = get_ipython()
364 rc = self.client
365 view = rc.activate(rc.ids)
366 view.block = False
367 self.assertEquals(view.targets, rc.ids)
368 for cell in ("pass", "1/0"):
369 with capture_output() as io:
370 try:
371 ip.run_cell_magic("px", "--block", cell)
372 except pmod.RemoteError:
373 pass
374 self.assertFalse('Async' in io.stdout)
375 self.assertFalse(view.block)
376
345
377
General Comments 0
You need to be logged in to leave comments. Login now