From 7787868e3af0baae8539990664852ddbe337ffb8 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 4 Sep 2025 15:48:38 +0200 Subject: [PATCH 1/2] ignore the new pattern --- xarray/tests/test_backends.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index c54e3c8d135..2301b0a5bf2 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -2555,7 +2555,7 @@ def test_read_non_consolidated_warning(self) -> None: def test_non_existent_store(self) -> None: with pytest.raises( FileNotFoundError, - match="(No such file or directory|Unable to find group|No group found in store)", + match="(No such file or directory|Unable to find group|No group found in store|does not exist)", ): xr.open_zarr(f"{uuid.uuid4()}") From 30ba12cd6214522b99dd857a6778b94f612c275b Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Thu, 4 Sep 2025 15:51:31 +0200 Subject: [PATCH 2/2] construct the pattern dynamically --- xarray/tests/test_backends.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 2301b0a5bf2..e36bbae6ebb 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -2553,10 +2553,13 @@ def test_read_non_consolidated_warning(self) -> None: assert_identical(ds, expected) def test_non_existent_store(self) -> None: - with pytest.raises( - FileNotFoundError, - match="(No such file or directory|Unable to find group|No group found in store|does not exist)", - ): + patterns = [ + "No such file or directory", + "Unable to find group", + "No group found in store", + "does not exist", + ] + with pytest.raises(FileNotFoundError, match=f"({'|'.join(patterns)})"): xr.open_zarr(f"{uuid.uuid4()}") @pytest.mark.skipif(has_zarr_v3, reason="chunk_store not implemented in zarr v3")