Skip to content

Commit

Permalink
consolidate a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Dec 4, 2024
1 parent 63dead2 commit c25a174
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 42 deletions.
33 changes: 33 additions & 0 deletions tests/test_store/test_stateful.py
Original file line number Diff line number Diff line change
@@ -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))
21 changes: 0 additions & 21 deletions tests/test_store/test_stateful_hierarchy.py

This file was deleted.

21 changes: 0 additions & 21 deletions tests/test_store/test_stateful_store.py

This file was deleted.

0 comments on commit c25a174

Please sign in to comment.