From 23a864aa9b1ce298be58506203c31abed6499d76 Mon Sep 17 00:00:00 2001 From: Joseph Gonzalez Date: Sat, 21 Sep 2024 20:19:55 -0400 Subject: [PATCH] Add a typehint to the modes to avoid issues with mypy --- xarray/tests/test_backends.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 919317fb0d0..ccf1bc73dd6 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -6161,7 +6161,8 @@ def test_zarr_safe_chunk_region(tmp_path): ).chunk(a=3) arr.to_zarr(store, mode="w") - for mode in ["r+", "a"]: + modes: list[Literal["r+", "a"]] = ["r+", "a"] + for mode in modes: with pytest.raises(ValueError): # There are two Dask chunks on the same Zarr chunk, # which means that it is unsafe in any mode