8000 test_dim_separator.py Generate fixtures when needed (#824) · ericpre/zarr-python@3a64977 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3a64977

Browse files
authored
test_dim_separator.py Generate fixtures when needed (zarr-developers#824)
* test_dim_separator.py Generate fixtures when needed see: conda-forge/zarr-feedstock#50 * Correct flake8 issues * Add 'pragma: no cover' to the one-off
1 parent 0ae77c7 commit 3a64977

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

zarr/tests/test_dim_separator.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,19 @@ def dataset(tmpdir, request):
3636
if which.startswith("static"):
3737
project_root = pathlib.Path(zarr.__file__).resolve().parent.parent
3838
if which.endswith("nested"):
39-
return str(project_root / "fixture/nested")
39+
static = project_root / "fixture/nested"
40+
generator = NestedDirectoryStore
4041
else:
41-
return str(project_root / "fixture/flat")
42+
static = project_root / "fixture/flat"
43+
generator = DirectoryStore
44+
45+
if not static.exists(): # pragma: no cover
46+
# store the data - should be one-time operation
47+
s = generator(str(static))
48+
a = zarr.open(store=s, mode="w", shape=(2, 2), dtype="<i8")
49+
a[:] = [[1, 2], [3, 4]]
50+
51+
return str(static)
4252

4353
if which.startswith("directory"):
4454
store_class = DirectoryStore

0 commit comments

Comments
 (0)
0