Skip to content

Commit acf737c

Browse files
committed
Add new ipython and jupyter backend tests
1 parent 8a711eb commit acf737c

File tree

9 files changed

+214
-8
lines changed

9 files changed

+214
-8
lines changed

lib/matplotlib/testing/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import subprocess
1010
import sys
1111

12+
import pytest
13+
1214
import matplotlib as mpl
1315
from matplotlib import _api
1416

@@ -177,3 +179,22 @@ def _has_tex_package(package):
177179
return True
178180
except FileNotFoundError:
179181
return False
182+
183+
184+
def ipython_in_subprocess(requested_backend_or_gui_framework, expected_backend):
185+
pytest.importorskip("IPython")
186+
187+
code = ("import matplotlib as mpl, matplotlib.pyplot as plt;"
188+
"fig, ax=plt.subplots(); ax.plot([1, 3, 2]); mpl.get_backend()")
189+
proc = subprocess_run_for_testing(
190+
[
191+
"ipython",
192+
"--no-simple-prompt",
193+
f"--matplotlib={requested_backend_or_gui_framework}",
194+
"-c", code,
195+
],
196+
check=True,
197+
capture_output=True,
198+
)
199+
200+
assert proc.stdout.strip() == f"Out[1]: '{expected_backend}'"

lib/matplotlib/testing/__init__.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ def subprocess_run_helper(
4747
) -> subprocess.CompletedProcess[str]: ...
4848
def _check_for_pgf(texsystem: str) -> bool: ...
4949
def _has_tex_package(package: str) -> bool: ...
50+
def ipython_in_subprocess(
51+
requested_backend_or_gui_framework: str,
52+
expected_backend: str,
53+
) -> None: ...
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import os
2+
from pathlib import Path
3+
from tempfile import TemporaryDirectory
4+
5+
import pytest
6+
7+
from matplotlib.testing import subprocess_run_for_testing
8+
9+
nbformat = pytest.importorskip('nbformat')
10+
pytest.importorskip('nbconvert')
11+
pytest.importorskip('ipykernel')
12+
pytest.importorskip('matplotlib_inline')
13+
14+
15+
def test_ipynb():
16+
nb_path = Path(__file__).parent / 'test_inline_01.ipynb'
17+
18+
with TemporaryDirectory() as tmpdir:
19+
out_path = Path(tmpdir, "out.ipynb")
20+
21+
subprocess_run_for_testing(
22+
["jupyter", "nbconvert", "--to", "notebook",
23+
"--execute", "--ExecutePreprocessor.timeout=500",
24+
"--output", str(out_path), str(nb_path)],
25+
env={**os.environ, "IPYTHONDIR": tmpdir},
26+
check=True)
27+
with out_path.open() as out:
28+
nb = nbformat.read(out, nbformat.current_nbformat)
29+
30+
errors = [output for cell in nb.cells for output in cell.get("outputs", [])
31+
if output.output_type == "error"]
32+
assert not errors
33+
34+
backend_outputs = nb.cells[2]["outputs"]
35+
assert backend_outputs[0]["data"]["text/plain"] == "'inline'"
36+
37+
image = nb.cells[1]["outputs"][1]["data"]
38+
assert image["text/plain"] == "<Figure size 300x200 with 1 Axes>"
39+
assert "image/png" in image

lib/matplotlib/tests/test_backend_macosx.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,8 @@ def new_choose_save_file(title, directory, filename):
4444
# Check the savefig.directory rcParam got updated because
4545
# we added a subdirectory "test"
4646
assert mpl.rcParams["savefig.directory"] == f"{tmp_path}/test"
47+
48+
49+
def test_ipython():
50+
from matplotlib.testing import ipython_in_subprocess
51+
ipython_in_subprocess("osx", "macosx")

lib/matplotlib/tests/test_backend_nbagg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ def test_ipynb():
3030
errors = [output for cell in nb.cells for output in cell.get("outputs", [])
3131
if output.output_type == "error"]
3232
assert not errors
33+
34+
backend_outputs = nb.cells[2]["outputs"]
35+
assert backend_outputs[0]["data"]["text/plain"] == "'notebook'"

lib/matplotlib/tests/test_backend_qt.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from matplotlib._pylab_helpers import Gcf
1515
from matplotlib import _c_internal_utils
1616

17-
1817
try:
1918
from matplotlib.backends.qt_compat import QtGui, QtWidgets # type: ignore # noqa
2019
from matplotlib.backends.qt_editor import _formlayout
@@ -375,3 +374,8 @@ def custom_handler(signum, frame):
375374
finally:
376375
# Reset SIGINT handler to what it was before the test
377376
signal.signal(signal.SIGINT, original_handler)
377+
378+
379+
def test_ipython():
380+
from matplotlib.testing import ipython_in_subprocess
381+
ipython_in_subprocess("qt", "qtagg")

lib/matplotlib/tests/test_backend_tk.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,8 @@ def test_figure(master):
261261
foreground="white")
262262
test_figure(root)
263263
print("success")
264+
265+
266+
def test_ipython():
267+
from matplotlib.testing import ipython_in_subprocess
268+
ipython_in_subprocess("tk", "tkagg")
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"%matplotlib inline\n",
10+
"import matplotlib.pyplot as plt"
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": 2,
16+
"metadata": {
17+
"collapsed": false,
18+
"jupyter": {
19+
"outputs_hidden": false
20+
}
21+
},
22+
"outputs": [
23+
{
24+
"data": {
25+
"text/plain": [
26+
"[<matplotlib.lines.Line2D at 0x11c2f29f0>]"
27+
]
28+
},
29+
"execution_count": 2,
30+
"metadata": {},
31+
"output_type": "execute_result"
32+
},
33+
{
34+
"data": {
35+
"image/png": "iVBORw0KGgoAAAANSUhEUgAAARwAAADFCAYAAACGsk2zAAAAPnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMC5kZXYwLCBodHRwczovL21hdHBsb3RsaWIub3JnL2X8QGkAAAAJcEhZcwAAD2EAAA9hAag/p2kAACTDSURBVHic7d17XFR1/sfx1wxXURhC5SaoeEO8AZoXUFFLJXVL2lpNLd39aReFvHWl3bbb/qLdUr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Kdu3b1dOnz6tHDp0SHniiScUe3t7JSMjQ61D+I2CggIlJSVFSUlJUQBl4cKFSkpKinL+/HlFURTl1VdfVZ566qmq8WfOnFEcHByUl156STl27JiyePFixcrKStm2bZtah1CNsccTHR2trF+/Xjl58qSSlpamzJkzR9FqtcrOnTvVOoTfmDlzpqLT6ZS9e/cqOTk5VVtRUVHVmIZ4P1lU4CiKonz88cdK+/btFVtbW2XAgAHKwYMHq/5t2LBhyrRp06qN//bbb5Vu3boptra2Ss+ePZXNmzebueK7M+aY5s6dWzXWzc1NGTt2rJKcnKxC1TX75WPh/95+OY5p06Ypw4YN+80+AQEBiq2trdKpUyflyy+/NHvdNTH2eP7+978rnTt3Vuzt7RUXFxdl+PDhyu7du9UpvgZ3Oh6g2v97Q7yf5Ho4QgizsZgejhDC8kngCCHMRgJHCGE2EjhCCLORwBFCmI0EjhDCbCRwhBBmI4EjhDAbCRwhhNlI4AghzEYCRwhhNv8PCRnDMpOE+9MAAAAASUVORK5CYII=",
36+
"text/plain": [
37+
"<Figure size 300x200 with 1 Axes>"
38+
]
39+
},
40+
"metadata": {},
41+
"output_type": "display_data"
42+
}
43+
],
44+
"source": [
45+
"fig, ax = plt.subplots(figsize=(3, 2))\n",
46+
"ax.plot([1, 3, 2])"
47+
]
48+
},
49+
{
50+
"cell_type": "code",
51+
"execution_count": 3,
52+
"metadata": {},
53+
"outputs": [
54+
{
55+
"data": {
56+
"text/plain": [
57+
"'inline'"
58+
]
59+
},
60+
"execution_count": 3,
61+
"metadata": {},
62+
"output_type": "execute_result"
63+
}
64+
],
65+
"source": [
66+
"import matplotlib\n",
67+
"matplotlib.get_backend()"
68+
]
69+
}
70+
],
71+
"metadata": {
72+
"kernelspec": {
73+
"display_name": "Python 3 (ipykernel)",
74+
"language": "python",
75+
"name": "python3"
76+
},
77+
"language_info": {
78+
"codemirror_mode": {
79+
"name": "ipython",
80+
"version": 3
81+
},
82+
"file_extension": ".py",
83+
"mimetype": "text/x-python",
84+
"name": "python",
85+
"nbconvert_exporter": "python",
86+
"pygments_lexer": "ipython3",
87+
"version": "3.12.2"
88+
},
89+
"toc": {
90+
"colors": {
91+
"hover_highlight": "#DAA520",
92+
"running_highlight": "#FF0000",
93+
"selected_highlight": "#FFD700"
94+
},
95+
"moveMenuLeft": true,
96+
"nav_menu": {
97+
"height": "12px",
98+
"width": "252px"
99+
},
100+
"navigate_menu": true,
101+
"number_sections": true,
102+
"sideBar": true,
103+
"threshold": 4,
104+
"toc_cell": false,
105+
"toc_section_display": "block",
106+
"toc_window_display": false,
107+
"widenNotebook": false
108+
}
109+
},
110+
"nbformat": 4,
111+
"nbformat_minor": 4
112+
}

lib/matplotlib/tests/test_nbagg_01.ipynb

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
},
99
"outputs": [],
1010
"source": [
11-
"import numpy as np\n",
12-
"import matplotlib.pyplot as plt\n",
13-
"%matplotlib notebook\n"
11+
"%matplotlib notebook\n",
12+
"import matplotlib.pyplot as plt"
1413
]
1514
},
1615
{
@@ -826,17 +825,31 @@
826825
],
827826
"source": [
828827
"fig, ax = plt.subplots()\n",
829-
"ax.plot(range(10))\n"
828+
"ax.plot(range(10))"
830829
]
831830
},
832831
{
833832
"cell_type": "code",
834-
"execution_count": null,
833+
"execution_count": 3,
835834
"metadata": {
836835
"collapsed": true
837836
},
838-
"outputs": [],
839-
"source": []
837+
"outputs": [
838+
{
839+
"data": {
840+
"text/plain": [
841+
"'notebook'"
842+
]
843+
},
844+
"execution_count": 3,
845+
"metadata": {},
846+
"output_type": "execute_result"
847+
}
848+
],
849+
"source": [
850+
"import matplotlib\n",
851+
"matplotlib.get_backend()"
852+
]
840853
}
841854
],
842855
"metadata": {

0 commit comments

Comments
 (0)