From 35671ef1391d024ad1ea80736914ba24bca13755 Mon Sep 17 00:00:00 2001 From: Michael Niklas Date: Thu, 15 Oct 2026 08:24:12 +0200 Subject: [PATCH] Accept numpy dev's error message in test_setitem numpy dev no longer uses the np.str_ repr in the 'could not convert string to float' message. Co-authored-by: Claude --- xarray/tests/test_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index a8f502a2d80..b0dfe9d89f2 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -4827,7 +4827,7 @@ def test_setitem(self) -> None: data4[{"dim2": [2, 3]}] = data3["var1"][{"dim2": [3, 4]}].values data5 = data4.astype(str) data5["var4"] = data4["var1"] - err_msg = r"could not convert string to float: np\.str_\('a'\)" + err_msg = r"could not convert string to float: (np\.str_\()?'a'\)?" with pytest.raises(ValueError, match=err_msg): data5[{"dim2": 1}] = "a"