|
18 | 18 | )
|
19 | 19 |
|
20 | 20 |
|
| 21 | +@pytest.fixture( |
| 22 | + params=["none", "temp_dir_str", "temp_dir_path", "store_path", "memory_store", "dict"] |
| 23 | +) |
| 24 | +def store_like(request): |
| 25 | + if request.param == "none": |
| 26 | + yield None |
| 27 | + elif request.param == "temp_dir_str": |
| 28 | + with tempfile.TemporaryDirectory() as temp_dir: |
| 29 | + yield temp_dir |
| 30 | + elif request.param == "temp_dir_path": |
| 31 | + with tempfile.TemporaryDirectory() as temp_dir: |
| 32 | + yield Path(temp_dir) |
| 33 | + elif request.param == "store_path": |
| 34 | + yield StorePath(store=MemoryStore(store_dict={}), path="/") |
| 35 | + elif request.param == "memory_store": |
| 36 | + yield MemoryStore(store_dict={}) |
| 37 | + elif request.param == "dict": |
| 38 | + yield {} |
| 39 | + |
| 40 | + |
21 | 41 | @pytest.mark.parametrize("path", ["foo", "foo/bar"])
|
22 | 42 | @pytest.mark.parametrize("write_group", [True, False])
|
23 | 43 | @pytest.mark.parametrize("zarr_format", [2, 3])
|
@@ -134,17 +154,6 @@ async def test_make_store_path_fsspec(monkeypatch) -> None:
|
134 | 154 | assert isinstance(store_path.store, FsspecStore)
|
135 | 155 |
|
136 | 156 |
|
137 |
| -@pytest.mark.parametrize( |
138 |
| - "store_like", |
139 |
| - [ |
140 |
| - None, |
141 |
| - tempfile.TemporaryDirectory().name, |
142 |
| - Path(tempfile.TemporaryDirectory().name), |
143 |
| - StorePath(store=MemoryStore(store_dict={}), path="/"), |
144 |
| - MemoryStore(store_dict={}), |
145 |
| - {}, |
146 |
| - ], |
147 |
| -) |
148 | 157 | async def test_make_store_path_storage_options_raises(store_like: StoreLike) -> None:
|
149 | 158 | with pytest.raises(TypeError, match="storage_options"):
|
150 | 159 | await make_store_path(store_like, storage_options={"foo": "bar"})
|
|
0 commit comments