Skip to content

Commit

Permalink
TST: add test for error
Browse files Browse the repository at this point in the history
  • Loading branch information
jklymak committed Oct 15, 2021
1 parent 2587052 commit 5b2ad5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/matplotlib/lines.py
Expand Up @@ -370,7 +370,10 @@ def __init__(self, xdata, ydata,
self.set_color(color)
if marker is None:
marker = 'none' # Default.
self._marker = MarkerStyle(marker, fillstyle)
if not isinstance(marker, MarkerStyle):
self._marker = MarkerStyle(marker, fillstyle)
else:
self._marker = marker

self._markevery = None
self._markersize = None
Expand Down
7 changes: 7 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Expand Up @@ -4906,6 +4906,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()
Expand Down

0 comments on commit 5b2ad5d

Please sign in to comment.