From 5d37e45dc8cd0702a91a8e93799c1be7a9fe9295 Mon Sep 17 00:00:00 2001 From: Jody Klymak Date: Fri, 15 Oct 2021 16:47:55 +0200 Subject: [PATCH] TST: add test for error --- lib/matplotlib/tests/test_axes.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index cb3d79358695..48f62524e62b 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -4936,6 +4936,13 @@ def test_shared_with_aspect_3(): assert round(expected, 4) == round(ax.get_aspect(), 4) +def test_shared_aspect_error(): + fig, axes = plt.subplots(1, 2, sharex=True, sharey=True) + axes[0].axis("equal") + with pytest.raises(RuntimeError, match=r"set_aspect\(..., adjustable="): + fig.draw_without_rendering() + + @pytest.mark.parametrize('twin', ('x', 'y')) def test_twin_with_aspect(twin): fig, ax = plt.subplots()