8000 temporary check · matplotlib/matplotlib@64b6642 · GitHub
[go: up one dir, main page]

Skip to content

Commit 64b6642

Browse files
committed
temporary check
1 parent 7d741c5 commit 64b6642

File tree

3 files changed

+6
-45
lines changed

3 files changed

+6
-45
lines changed

lib/matplotlib/tests/test_backend_gtk3.py

Lines changed: 0 additions & 23 deletions
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

Lines changed: 6 additions & 6 deletions
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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,22 +196,6 @@ class Toolbar(NavigationToolbar2Tk):
196196
print("success")
197197

198198

199-
@_isolated_tk_test(success_count=1)
200-
def test_save_figure_return():
201-
import matplotlib.pyplot as plt
202-
from unittest import mock
203-
fig = plt.figure()
204-
prop = "tkinter.filedialog.asksaveasfilename"
205-
with mock.patch(prop, return_value="foobar.png"):
206-
fname = fig.canvas.manager.toolbar.save_figure()
207-
os.remove("foobar.png")
208-
assert fname == "foobar.png"
209-
with mock.patch(prop, return_value=""):
210-
fname = fig.canvas.manager.toolbar.save_figure()
211-
assert fname is None
212-
print("success")
213-
214-
215199
@_isolated_tk_test(success_count=1)
216200
def test_canvas_focus():
217201
import tkinter as tk

0 commit comments

Comments
 (0)
0