diff --git a/tests/test_store/test_stateful.py b/tests/test_store/test_stateful.py new file mode 100644 index 0000000000..ae10ca8d79 --- /dev/null +++ b/tests/test_store/test_stateful.py @@ -0,0 +1,33 @@ +# Stateful tests for arbitrary Zarr stores. +import pytest +from hypothesis.stateful import ( + Settings, + run_state_machine_as_test, +) + +from zarr.abc.store import Store +from zarr.storage import LocalStore, MemoryStore, ZipStore +from zarr.testing.stateful import ZarrHierarchyStateMachine, ZarrStoreStateMachine + + +def test_zarr_hierarchy(sync_store: Store): + def mk_test_instance_sync() -> ZarrHierarchyStateMachine: + return ZarrHierarchyStateMachine(sync_store) + + if isinstance(sync_store, ZipStore): + pytest.skip(reason="ZipStore does not support delete") + if isinstance(sync_store, MemoryStore): + run_state_machine_as_test( + mk_test_instance_sync, settings=Settings(report_multiple_bugs=False) + ) + + +def test_zarr_store(sync_store: Store) -> None: + def mk_test_instance_sync() -> None: + return ZarrStoreStateMachine(sync_store) + + if isinstance(sync_store, ZipStore): + pytest.skip(reason="ZipStore does not support delete") + if isinstance(sync_store, LocalStore): + pytest.skip(reason="This test has errors") + run_state_machine_as_test(mk_test_instance_sync, settings=Settings(report_multiple_bugs=True)) diff --git a/tests/test_store/test_stateful_hierarchy.py b/tests/test_store/test_stateful_hierarchy.py deleted file mode 100644 index 8b4a46a7e7..0000000000 --- a/tests/test_store/test_stateful_hierarchy.py +++ /dev/null @@ -1,21 +0,0 @@ -import pytest -from hypothesis.stateful import ( - Settings, - run_state_machine_as_test, -) - -from zarr.abc.store import Store -from zarr.storage import MemoryStore, ZipStore -from zarr.testing.stateful import ZarrHierarchyStateMachine - - -def test_zarr_hierarchy(sync_store: Store): - def mk_test_instance_sync() -> ZarrHierarchyStateMachine: - return ZarrHierarchyStateMachine(sync_store) - - if isinstance(sync_store, ZipStore): - pytest.skip(reason="ZipStore does not support delete") - if isinstance(sync_store, MemoryStore): - run_state_machine_as_test( - mk_test_instance_sync, settings=Settings(report_multiple_bugs=False) - ) diff --git a/tests/test_store/test_stateful_store.py b/tests/test_store/test_stateful_store.py deleted file mode 100644 index 1d1817cef5..0000000000 --- a/tests/test_store/test_stateful_store.py +++ /dev/null @@ -1,21 +0,0 @@ -# Stateful tests for arbitrary Zarr stores. -import pytest -from hypothesis.stateful import ( - Settings, - run_state_machine_as_test, -) - -from zarr.abc.store import Store -from zarr.storage import LocalStore, ZipStore -from zarr.testing.stateful import ZarrStoreStateMachine - - -def test_zarr_hierarchy(sync_store: Store) -> None: - def mk_test_instance_sync() -> None: - return ZarrStoreStateMachine(sync_store) - - if isinstance(sync_store, ZipStore): - pytest.skip(reason="ZipStore does not support delete") - if isinstance(sync_store, LocalStore): - pytest.skip(reason="This test has errors") - run_state_machine_as_test(mk_test_instance_sync, settings=Settings(report_multiple_bugs=True))