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

Skip to content

Commit 400445a

Browse files
committed
TST: add test for error
1 parent 131ddad commit 400445a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4938,6 +4938,13 @@ def test_shared_with_aspect_3():
49384938
assert round(expected, 4) == round(ax.get_aspect(), 4)
49394939

49404940

4941+
def test_shared_aspect_error():
4942+
fig, axes = plt.subplots(1, 2, sharex=True, sharey=True)
4943+
axes[0].axis("equal")
4944+
with pytest.raises(RuntimeError, match=r"set_aspect\(..., adjustable="):
4945+
fig.draw_without_rendering()
4946+
4947+
49414948
@pytest.mark.parametrize('twin', ('x', 'y'))
49424949
def test_twin_with_aspect(twin):
49434950
fig, ax = plt.subplots()

0 commit comments

Comments
 (0)