8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c58a062 commit c474811Copy full SHA for c474811
lib/matplotlib/tests/test_backend_tk.py
@@ -196,6 +196,19 @@ class Toolbar(NavigationToolbar2Tk):
196
print("success")
197
198
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
+ print("success")
210
+
211
212
@_isolated_tk_test(success_count=1)
213
def test_canvas_focus():
214
import tkinter as tk
0 commit comments