File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -440,24 +440,28 @@ def test_result(self):
440440 ip .run_line_magic ('pxresult' , '' )
441441 assert str (data [name ]) in io .stdout
442442
443- def test_px_pylab (self ):
444- """%pylab works on engines"""
443+ def test_px_matplotlib (self ):
444+ """%matplotlib inline works on engines"""
445445 pytest .importorskip ('matplotlib' )
446446 ip = get_ipython ()
447447 v = self .client [- 1 ]
448448 v .block = True
449449 v .activate ()
450450
451451 with capture_output () as io :
452- ip .run_line_magic ("px" , "%pylab inline" )
453-
454- assert (
455- "Populating the interactive namespace from numpy and matplotlib"
456- in io .stdout
457- )
452+ ip .run_line_magic (
453+ "px" ,
454+ "\n " .join (
455+ [
456+ "%matplotlib inline" ,
457+ "import numpy as np" ,
458+ "import matplotlib.pyplot as plt" ,
459+ ]
460+ ),
461+ )
458462
459463 with capture_output (display = False ) as io :
460- ip .run_line_magic ("px" , "plot(rand(100))" )
464+ ip .run_line_magic ("px" , "plt. plot(np.random. rand(100))" )
461465 assert 'Out[' in io .stdout
462466 assert 'matplotlib.lines' in io .stdout
463467
You can’t perform that action at this time.
0 commit comments