File tree 1 file changed +13
-9
lines changed
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):
440
440
ip .run_line_magic ('pxresult' , '' )
441
441
assert str (data [name ]) in io .stdout
442
442
443
- def test_px_pylab (self ):
444
- """%pylab works on engines"""
443
+ def test_px_matplotlib (self ):
444
+ """%matplotlib inline works on engines"""
445
445
pytest .importorskip ('matplotlib' )
446
446
ip = get_ipython ()
447
447
v = self .client [- 1 ]
448
448
v .block = True
449
449
v .activate ()
450
450
451
451
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
+ )
458
462
459
463
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. rand(100))" )
461
465
assert 'Out[' in io .stdout
462
466
assert 'matplotlib.lines' in io .stdout
463
467
You can’t perform that action at this time.
0 commit comments