From 40e9a36083aac5e01b3ebe1bf7760ebab930006b Mon Sep 17 00:00:00 2001 From: Henry Wright Date: Thu, 31 Oct 2024 16:42:56 +0000 Subject: [PATCH] fix some test failures --- lib/iris/tests/unit/fileformats/cf/test_CFReader.py | 4 ++-- lib/iris/tests/unit/util/test_broadcast_to_shape.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py index 42019bb9f8..7f37eb9f24 100644 --- a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py +++ b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py @@ -307,7 +307,7 @@ def test_formula_terms_ignore(self): def test_auxiliary_ignore(self): self.x.dimensions = ["lat", "wibble"] - with pytest.warns(match="Ignoring variable 'x'"): + with pytest.warns(match=r"Ignoring variable x"): cf_group = CFReader("dummy").cf_group promoted = ["x", "orography"] group = cf_group.promoted @@ -319,7 +319,7 @@ def test_promoted_auxiliary_ignore(self): self.wibble = netcdf_variable("wibble", "lat wibble", np.float64) self.variables["wibble"] = self.wibble self.orography.coordinates = "wibble" - with pytest.warns(match="Ignoring variable 'wibble'") as warns: + with pytest.warns(match="Ignoring variable wibble") as warns: cf_group = CFReader("dummy").cf_group.promoted promoted = ["wibble", "orography"] assert set(cf_group.keys()) == set(promoted) diff --git a/lib/iris/tests/unit/util/test_broadcast_to_shape.py b/lib/iris/tests/unit/util/test_broadcast_to_shape.py index c18ba22cfb..75dd2c6f97 100644 --- a/lib/iris/tests/unit/util/test_broadcast_to_shape.py +++ b/lib/iris/tests/unit/util/test_broadcast_to_shape.py @@ -102,7 +102,9 @@ def test_lazy_chunks(self, mocked_compute): mocked_compute.assert_not_called() for i in range(3): for j in range(4): - self.assertMaskedArrayEqual(b[i, j, :].compute(), m[0].compute()) + _shared_utils.assert_masked_array_equal( + b[i, j, :].compute(), m[0].compute() + ) assert b.chunks == ((1, 1, 1), (2, 2), (2, 2, 1)) def test_masked_degenerate(self):