From 3438301623e9d9dfaab1a2f8171679d972cd5f2d Mon Sep 17 00:00:00 2001 From: Ruth Comer <10599679+rcomer@users.noreply.github.com> Date: Fri, 7 Jul 2023 07:48:48 +0100 Subject: [PATCH] TST: simplify mask in pcolor writing to mask test --- lib/matplotlib/tests/test_axes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 30c7e34c937b..ed84c976d7ec 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -1507,16 +1507,16 @@ def test_pcolorargs_with_read_only(): y = np.linspace(0, 1, 10) X, Y = np.meshgrid(x, y) Z = np.sin(2 * np.pi * X) * np.cos(2 * np.pi * Y) - mask = np.broadcast_to([True, False] * 5, Z.shape) + mask = np.zeros(10, dtype=bool) + mask[-1] = True + mask = np.broadcast_to(mask, Z.shape) assert mask.flags.writeable is False masked_Z = np.ma.array(Z, mask=mask) plt.pcolormesh(X, Y, masked_Z) masked_X = np.ma.array(X, mask=mask) masked_Y = np.ma.array(Y, mask=mask) - with pytest.warns(UserWarning, - match='are not monotonically increasing or decreasing'): - plt.pcolor(masked_X, masked_Y, masked_Z) + plt.pcolor(masked_X, masked_Y, masked_Z) @check_figures_equal(extensions=["png"])