|
19 | 19 | from zarr._storage.store import v3_api_available
|
20 | 20 | from zarr._storage.v3 import DirectoryStoreV3, KVStoreV3
|
21 | 21 | from zarr.sync import ThreadSynchronizer
|
22 |
| -from zarr.tests.util import mktemp |
| 22 | +from zarr.tests.util import mktemp, have_fsspec |
23 | 23 |
|
24 | 24 | _VERSIONS = ((None, 2, 3) if v3_api_available else (None, 2))
|
25 | 25 | _VERSIONS2 = ((2, 3) if v3_api_available else (2, ))
|
@@ -429,6 +429,18 @@ def test_create_in_dict(zarr_version, at_root):
|
429 | 429 | assert isinstance(a.store, expected_store_type)
|
430 | 430 |
|
431 | 431 |
|
| 432 | +@pytest.mark.skipif(have_fsspec is False, reason="needs fsspec") |
| 433 | +@pytest.mark.parametrize('zarr_version', _VERSIONS) |
| 434 | +@pytest.mark.parametrize('at_root', [False, True]) |
| 435 | +def test_create_writeable_mode(zarr_version, at_root, tmp_path): |
| 436 | + # Regression test for https://github.com/zarr-developers/zarr-python/issues/1306 |
| 437 | + import fsspec |
| 438 | + kwargs = _init_creation_kwargs(zarr_version, at_root) |
| 439 | + store = fsspec.get_mapper(str(tmp_path)) |
| 440 | + z = create(100, store=store, **kwargs) |
| 441 | + assert z.store.map == store |
| 442 | + |
| 443 | + |
432 | 444 | @pytest.mark.parametrize('zarr_version', _VERSIONS)
|
433 | 445 | @pytest.mark.parametrize('at_root', [False, True])
|
434 | 446 | def test_empty_like(zarr_version, at_root):
|
|
0 commit comments