Skip to content

Commit

Permalink
Add a typehint to the modes to avoid issues with mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
josephnowak committed Sep 22, 2024
1 parent ed88fa7 commit 23a864a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xarray/tests/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 23a864a

Please sign in to comment.