Skip to content

Commit 2ef7a4d

Browse files
committed
Fix LocalStore test
1 parent 01edfca commit 2ef7a4d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/zarr/storage/_local.py

+7
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ async def delete(self, key: str) -> None:
208208
else:
209209
await asyncio.to_thread(path.unlink, True) # Q: we may want to raise if path is missing
210210

211+
async def delete_dir(self, key: str) -> None:
212+
# docstring inherited
213+
self._check_writable()
214+
path = self.root / key
215+
if path.is_dir():
216+
shutil.rmtree(path)
217+
211218
async def exists(self, key: str) -> bool:
212219
# docstring inherited
213220
path = self.root / key

tests/test_store/test_stateful.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
)
66

77
from zarr.abc.store import Store
8-
from zarr.storage import ZipStore
8+
from zarr.storage import LocalStore, ZipStore
99
from zarr.testing.stateful import ZarrHierarchyStateMachine, ZarrStoreStateMachine
1010

1111
pytestmark = pytest.mark.slow_hypothesis
@@ -28,4 +28,6 @@ def mk_test_instance_sync() -> None:
2828
if isinstance(sync_store, ZipStore):
2929
pytest.skip(reason="ZipStore does not support delete")
3030

31+
if isinstance(sync_store, LocalStore):
32+
pytest.skip(reason="Test isn't suitable for LocalStore.")
3133
run_state_machine_as_test(mk_test_instance_sync)

0 commit comments

Comments
 (0)