Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 196cbf2

Browse files
committed
TST: add test that ipython --pylab works as expected
1 parent 27969d6 commit 196cbf2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/matplotlib/tests/test_pyplot.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import difflib
22
import numpy as np
3+
import os
34
import subprocess
45
import sys
56
from pathlib import Path
@@ -367,3 +368,23 @@ def test_set_current_axes_on_subfigure():
367368
assert plt.gca() != ax
368369
plt.sca(ax)
369370
assert plt.gca() == ax
371+
372+
373+
def test_pylab_intergation():
374+
pytest.importorskip("IPython")
375+
subprocess.run(
376+
[
377+
sys.executable,
378+
"-m",
379+
"IPython",
380+
"--pylab",
381+
"-c",
382+
"import matplotlib.pyplot as plt; assert plt._REPL_DISPLAYHOOK == plt._ReplDisplayHook.IPYTHON", # noqa
383+
],
384+
env={**os.environ, "SOURCE_DATE_EPOCH": "0"},
385+
timeout=5,
386+
check=True,
387+
stdout=subprocess.PIPE,
388+
stderr=subprocess.PIPE,
389+
universal_newlines=True,
390+
)

0 commit comments

Comments
 (0)