Skip to content

Commit 01cf884

Browse files
committed
Add test
1 parent 0286bd6 commit 01cf884

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
@@ -333,8 +333,12 @@ def test_open_with_mode_r(tmp_path: Path) -> None:
333333

334334
def test_open_with_mode_r_plus(tmp_path: Path) -> None:
335335
# 'r+' means read/write (must exist)
336+
new_store_path = tmp_path / "new_store.zarr"
337+
assert not new_store_path.exists(), "Test should operate on non-existent directory"
336338
with pytest.raises(FileNotFoundError):
337-
zarr.open(store=tmp_path, mode="r+")
339+
zarr.open(store=new_store_path, mode="r+")
340+
assert not new_store_path.exists(), "mode='r+' should not create directory"
341+
338342
zarr.ones(store=tmp_path, shape=(3, 3))
339343
z2 = zarr.open(store=tmp_path, mode="r+")
340344
assert isinstance(z2, Array)

0 commit comments

Comments
 (0)