-
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
17 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,22 @@ | ||
# 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, max_examples=50) | ||
) | ||
run_state_machine_as_test(mk_test_instance_sync, settings=Settings(max_examples=50)) | ||
|
||
|
||
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") | ||
elif isinstance(sync_store, LocalStore): | ||
pytest.skip(reason="This test has errors") | ||
elif isinstance(sync_store, MemoryStore): | ||
run_state_machine_as_test(mk_test_instance_sync, settings=Settings(max_examples=50)) | ||
else: | ||
run_state_machine_as_test( | ||
mk_test_instance_sync, settings=Settings(report_multiple_bugs=True) | ||
) | ||
run_state_machine_as_test(mk_test_instance_sync, settings=Settings(max_examples=50)) |