()
| 247 | |
| 248 | @pytest.mark.backend('QtAgg', skip_on_importerror=True) |
| 249 | def test_double_resize(): |
| 250 | # Check that resizing a figure twice keeps the same window size |
| 251 | fig, ax = plt.subplots() |
| 252 | fig.canvas.draw() |
| 253 | window = fig.canvas.manager.window |
| 254 | |
| 255 | w, h = 3, 2 |
| 256 | fig.set_size_inches(w, h) |
| 257 | assert fig.canvas.width() == w * matplotlib.rcParams['figure.dpi'] |
| 258 | assert fig.canvas.height() == h * matplotlib.rcParams['figure.dpi'] |
| 259 | |
| 260 | old_width = window.width() |
| 261 | old_height = window.height() |
| 262 | |
| 263 | fig.set_size_inches(w, h) |
| 264 | assert window.width() == old_width |
| 265 | assert window.height() == old_height |
| 266 | |
| 267 | |
| 268 | @pytest.mark.backend('QtAgg', skip_on_importerror=True) |
nothing calls this directly
no test coverage detected
searching dependent graphs…