@@ -173,18 +173,18 @@ def test_cellpx_groupby_order(self):
173
173
expected .extend (
174
174
[
175
175
r'\[output:\d+\]' ,
176
- 'IPython.core.display .HTML' ,
176
+ 'IPython..+ .HTML' ,
177
177
]
178
178
* len (v )
179
179
)
180
180
expected .extend (
181
181
[
182
182
r'\[output:\d+\]' ,
183
- 'IPython.core.display .Math' ,
183
+ 'IPython..+ .Math' ,
184
184
]
185
185
* len (v )
186
186
)
187
- expected .extend ([r'Out\[\d+:\d+\]:.*IPython\.core\.display \.Math' ] * len (v ))
187
+ expected .extend ([r'Out\[\d+:\d+\]:.*IPython\..+ \.Math' ] * len (v ))
188
188
189
189
assert len (lines ), len (expected ) == io .stdout
190
190
for line , expect in zip (lines , expected ):
@@ -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.random. rand(100))" )
461
465
assert 'Out[' in io .stdout
462
466
assert 'matplotlib.lines' in io .stdout
463
467
0 commit comments