Skip to content

Commit 1ea856d

Browse files
committed
TST: verify that dpi is restored on close
1 parent db30cbe commit 1ea856d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/tests/test_backend_qt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ def set_device_pixel_ratio(ratio):
215215
assert qt_canvas.get_width_height() == (600, 240)
216216
assert (fig.get_size_inches() == (5, 2)).all()
217217

218+
# check that closing the figure restores the original dpi
219+
plt.close(fig)
220+
assert fig.dpi == 120
221+
218222

219223
@pytest.mark.backend('QtAgg', skip_on_importerror=True)
220224
def test_subplottool():

0 commit comments

Comments
 (0)