Skip to content

Commit 470f832

Browse files
committed
temporary check
1 parent 7d741c5 commit 470f832

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

lib/matplotlib/tests/test_backend_gtk3.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ def test_save_figure_return():
6767
os.remove("foobar.png")
6868
assert fname == "foobar.png"
6969

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
70+
with mock.patch("gi.repository.Gtk.MessageDialog"):
71+
dialog.get_filename.return_value = None
72+
dialog.run.return_value = Gtk.ResponseType.OK
73+
fname = fig.canvas.manager.toolbar.save_figure()
74+
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)