Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a12a7ee

Browse files
committed
Bump test coverage of Qt5 UI.
This does not actually test user input, only that the UIs can be constructed from the toolbar.
1 parent 4937314 commit a12a7ee

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

lib/matplotlib/tests/test_backend_qt5.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,23 @@ def test_dpi_ratio_change():
161161
assert size.height() == 240
162162
assert_equal(qt_canvas.get_width_height(), (600, 240))
163163
assert_equal(fig.get_size_inches(), (5, 2))
164+
165+
166+
@pytest.mark.backend('Qt5Agg')
167+
def test_subplottool():
168+
fig, ax = plt.subplots()
169+
with mock.patch(
170+
"matplotlib.backends.backend_qt5.SubplotToolQt.exec_",
171+
lambda self: None):
172+
fig.canvas.manager.toolbar.configure_subplots()
173+
174+
175+
@pytest.mark.backend('Qt5Agg')
176+
def test_figureoptions():
177+
fig, ax = plt.subplots()
178+
ax.plot([1, 2])
179+
ax.imshow([[1]])
180+
with mock.patch(
181+
"matplotlib.backends.qt_editor.formlayout.FormDialog.exec_",
182+
lambda self: None):
183+
fig.canvas.manager.toolbar.edit_parameters()

0 commit comments

Comments
 (0)