Skip to content

Commit c25a174

Browse files
committed
consolidate a bit
1 parent 63dead2 commit c25a174

File tree

3 files changed

+33
-42
lines changed

3 files changed

+33
-42
lines changed

tests/test_store/test_stateful.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Stateful tests for arbitrary Zarr stores.
2+
import pytest
3+
from hypothesis.stateful import (
4+
Settings,
5+
run_state_machine_as_test,
6+
)
7+
8+
from zarr.abc.store import Store
9+
from zarr.storage import LocalStore, MemoryStore, ZipStore
10+
from zarr.testing.stateful import ZarrHierarchyStateMachine, ZarrStoreStateMachine
11+
12+
13+
def test_zarr_hierarchy(sync_store: Store):
14+
def mk_test_instance_sync() -> ZarrHierarchyStateMachine:
15+
return ZarrHierarchyStateMachine(sync_store)
16+
17+
if isinstance(sync_store, ZipStore):
18+
pytest.skip(reason="ZipStore does not support delete")
19+
if isinstance(sync_store, MemoryStore):
20+
run_state_machine_as_test(
21+
mk_test_instance_sync, settings=Settings(report_multiple_bugs=False)
22+
)
23+
24+
25+
def test_zarr_store(sync_store: Store) -> None:
26+
def mk_test_instance_sync() -> None:
27+
return ZarrStoreStateMachine(sync_store)
28+
29+
if isinstance(sync_store, ZipStore):
30+
pytest.skip(reason="ZipStore does not support delete")
31+
if isinstance(sync_store, LocalStore):
32+
pytest.skip(reason="This test has errors")
33+
run_state_machine_as_test(mk_test_instance_sync, settings=Settings(report_multiple_bugs=True))

tests/test_store/test_stateful_hierarchy.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/test_store/test_stateful_store.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)