Skip to content

Commit 0bcd8d8

Browse files
committed
don't test old-timey pylab
test matplotlib directly
1 parent 421fd32 commit 0bcd8d8

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

Diff for: ipyparallel/tests/test_magics.py

+13-9
Original file line numberDiff line numberDiff 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.rand(100))")
461465
assert 'Out[' in io.stdout
462466
assert 'matplotlib.lines' in io.stdout
463467

0 commit comments

Comments
 (0)