From c2265d46e9a16327deab1dffb3c22ea3022fdf50 Mon Sep 17 00:00:00 2001 From: Bouwe Andela Date: Thu, 11 Jan 2024 16:25:42 +0100 Subject: [PATCH] Add tests --- lib/iris/tests/unit/util/test_array_equal.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/iris/tests/unit/util/test_array_equal.py b/lib/iris/tests/unit/util/test_array_equal.py index 38b9652443..f63092587c 100644 --- a/lib/iris/tests/unit/util/test_array_equal.py +++ b/lib/iris/tests/unit/util/test_array_equal.py @@ -101,12 +101,15 @@ def test_string_arrays_0d_and_scalar(self): self.assertFalse(array_equal(array_a, "foobar.")) def test_nan_equality_nan_ne_nan(self): - array = np.array([1.0, np.nan, 2.0, np.nan, 3.0]) - self.assertFalse(array_equal(array, array)) + array_a = np.array([1.0, np.nan, 2.0, np.nan, 3.0]) + array_b = array_a.copy() + self.assertFalse(array_equal(array_a, array_a)) + self.assertFalse(array_equal(array_a, array_b)) def test_nan_equality_nan_naneq_nan(self): array_a = np.array([1.0, np.nan, 2.0, np.nan, 3.0]) array_b = np.array([1.0, np.nan, 2.0, np.nan, 3.0]) + self.assertTrue(array_equal(array_a, array_a, withnans=True)) self.assertTrue(array_equal(array_a, array_b, withnans=True)) def test_nan_equality_nan_nanne_a(self):