Skip to content

Commit ae7bd7f

Browse files
committed
Reuse subprocess_run_helper in test_pylab_integration.
It's basically here for that purpose...
1 parent b31c5ae commit ae7bd7f

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

lib/matplotlib/tests/test_pyplot.py

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import difflib
22
import numpy as np
3-
import os
43
import subprocess
54
import sys
65
from pathlib import Path
@@ -371,23 +370,13 @@ def test_set_current_axes_on_subfigure():
371370

372371

373372
def test_pylab_integration():
374-
pytest.importorskip("IPython")
375-
subprocess.run(
376-
[
377-
sys.executable,
378-
"-m",
379-
"IPython",
380-
"--pylab",
381-
"-c",
382-
";".join((
383-
"import matplotlib.pyplot as plt",
384-
"assert plt._REPL_DISPLAYHOOK == plt._ReplDisplayHook.IPYTHON",
385-
)),
386-
],
387-
env={**os.environ, "SOURCE_DATE_EPOCH": "0"},
373+
mpl.testing.subprocess_run_helper(
374+
pytest.importorskip("IPython").start_ipython,
375+
"--pylab",
376+
"-c",
377+
";".join((
378+
"import matplotlib.pyplot as plt",
379+
"assert plt._REPL_DISPLAYHOOK == plt._ReplDisplayHook.IPYTHON",
380+
)),
388381
timeout=60,
389-
check=True,
390-
stdout=subprocess.PIPE,
391-
stderr=subprocess.PIPE,
392-
universal_newlines=True,
393382
)

0 commit comments

Comments
 (0)