diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index a4026486a3c..420f4f0ed25 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -2653,10 +2653,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")