Skip to content

Commit 20c4e55

Browse files
committed
temporary check
1 parent 7d741c5 commit 20c4e55

File tree

3 files changed

+9
-31
lines changed

3 files changed

+9
-31
lines changed

lib/matplotlib/tests/test_backend_gtk3.py

-23
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,3 @@ def receive(event):
4848
fig.canvas.mpl_connect("draw_event", send)
4949
fig.canvas.mpl_connect("key_press_event", receive)
5050
plt.show()
51-
52-
53-
@pytest.mark.backend("gtk3agg", skip_on_importerror=True)
54-
def test_save_figure_return():
55-
from gi.repository import Gtk
56-
fig, ax = plt.subplots()
57-
ax.imshow([[1]])
58-
with mock.patch("gi.repository.Gtk.FileFilter") as fileFilter:
59-
filt = fileFilter.return_value
60-
filt.get_name.return_value = "Portable Network Graphics"
61-
with mock.patch("gi.repository.Gtk.FileChooserDialog") as dialogChooser:
62-
dialog = dialogChooser.return_value
63-
dialog.get_filter.return_value = filt
64-
dialog.get_filename.return_value = "foobar.png"
65-
dialog.run.return_value = Gtk.ResponseType.OK
66-
fname = fig.canvas.manager.toolbar.save_figure()
67-
os.remove("foobar.png")
68-
assert fname == "foobar.png"
69-
70-
dialog.get_filename.return_value = None
71-
dialog.run.return_value = Gtk.ResponseType.OK
72-
fname = fig.canvas.manager.toolbar.save_figure()
73-
assert fname is None

lib/matplotlib/tests/test_backend_macosx.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ def new_choose_save_file(title, directory, filename):
4747
assert mpl.rcParams["savefig.directory"] == f"{tmp_path}/test"
4848

4949

50+
@pytest.mark.backend('macosx')
51+
def test_ipython():
52+
from matplotlib.testing import ipython_in_subprocess
53+
ipython_in_subprocess("osx", {(8, 24): "macosx", (7, 0): "MacOSX"})
54+
55+
5056
@pytest.mark.backend('macosx')
5157
def test_save_figure_return():
5258
fig, ax = plt.subplots()
@@ -59,9 +65,3 @@ def test_save_figure_return():
5965
with mock.patch(prop, return_value=None):
6066
fname = fig.canvas.manager.toolbar.save_figure()
6167
assert fname is None
62-
63-
64-
@pytest.mark.backend('macosx')
65-
def test_ipython():
66-
from matplotlib.testing import ipython_in_subprocess
67-
ipython_in_subprocess("osx", {(8, 24): "macosx", (7, 0): "MacOSX"})

lib/matplotlib/tests/test_backend_tk.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class Toolbar(NavigationToolbar2Tk):
196196
print("success")
197197

198198

199-
@_isolated_tk_test(success_count=1)
199+
@_isolated_tk_test(success_count=2)
200200
def test_save_figure_return():
201201
import matplotlib.pyplot as plt
202202
from unittest import mock
@@ -206,10 +206,11 @@ def test_save_figure_return():
206206
fname = fig.canvas.manager.toolbar.save_figure()
207207
os.remove("foobar.png")
208208
assert fname == "foobar.png"
209+
print("success")
209210
with mock.patch(prop, return_value=""):
210211
fname = fig.canvas.manager.toolbar.save_figure()
211212
assert fname is None
212-
print("success")
213+
print("success")
213214

214215

215216
@_isolated_tk_test(success_count=1)

0 commit comments

Comments
 (0)