diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index cc88ccf0708..8c9d13d8596 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -3839,7 +3839,7 @@ def test_to_dataset_coord_value_is_dim(self) -> None: match=( re.escape("dimension 'x' would produce the variables ('a',)") + ".*" - + re.escape("rename(a=...) or assign_coords(x=...)") + + re.escape("DataArray.rename(a=...) or DataArray.assign_coords(x=...)") ), ): array.to_dataset("x") @@ -3860,7 +3860,9 @@ def test_to_dataset_coord_value_is_dim(self) -> None: match=( re.escape("dimension 'x' would produce the variables ('a', 'b')") + ".*" - + re.escape("rename(a=..., b=...) or assign_coords(x=...)") + + re.escape( + "DataArray.rename(a=..., b=...) or DataArray.assign_coords(x=...)" + ) ), ): array2.to_dataset("x")