Skip to content

Commit 896db3d

Browse files
committed
Add test
1 parent 835b6aa commit 896db3d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,12 @@ def test_open_with_mode_r(tmp_path: Path) -> None:
285285

286286
def test_open_with_mode_r_plus(tmp_path: Path) -> None:
287287
# 'r+' means read/write (must exist)
288+
new_store_path = tmp_path / "new_store.zarr"
289+
assert not new_store_path.exists(), "Test should operate on non-existent directory"
288290
with pytest.raises(FileNotFoundError):
289-
zarr.open(store=tmp_path, mode="r+")
291+
zarr.open(store=new_store_path, mode="r+")
292+
assert not new_store_path.exists(), "mode='r+' should not create directory"
293+
290294
zarr.ones(store=tmp_path, shape=(3, 3))
291295
z2 = zarr.open(store=tmp_path, mode="r+")
292296
assert isinstance(z2, Array)

0 commit comments

Comments
 (0)