@@ -173,18 +173,18 @@ def test_cellpx_groupby_order(self):
173173 expected .extend (
174174 [
175175 r'\[output:\d+\]' ,
176- 'IPython.core.display .HTML' ,
176+ 'IPython..+ .HTML' ,
177177 ]
178178 * len (v )
179179 )
180180 expected .extend (
181181 [
182182 r'\[output:\d+\]' ,
183- 'IPython.core.display .Math' ,
183+ 'IPython..+ .Math' ,
184184 ]
185185 * len (v )
186186 )
187- expected .extend ([r'Out\[\d+:\d+\]:.*IPython\.core\.display \.Math' ] * len (v ))
187+ expected .extend ([r'Out\[\d+:\d+\]:.*IPython\..+ \.Math' ] * len (v ))
188188
189189 assert len (lines ), len (expected ) == io .stdout
190190 for line , expect in zip (lines , expected ):
@@ -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
0 commit comments