From e56dcd8268887898b742cd37fd22657774d0c78f Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Fri, 9 Sep 2022 12:39:08 +0200 Subject: [PATCH] requires Zarr v2.13+ --- python/benchmarks/single-node-io.py | 2 +- python/tests/test_benchmarks.py | 2 +- python/tests/test_zarr.py | 12 +++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/python/benchmarks/single-node-io.py b/python/benchmarks/single-node-io.py index 4b56090f77..0492100216 100644 --- a/python/benchmarks/single-node-io.py +++ b/python/benchmarks/single-node-io.py @@ -202,7 +202,7 @@ def run_zarr(args): dir_path = args.dir / "zarr" if not hasattr(zarr.Array, "meta_array"): - RuntimeError("Requires Zarr v2.13.0+ for CuPy support") + raise RuntimeError("requires Zarr v2.13+") a = cupy.arange(args.nbytes, dtype="uint8") diff --git a/python/tests/test_benchmarks.py b/python/tests/test_benchmarks.py index 21ebb2f737..c888fdbd19 100644 --- a/python/tests/test_benchmarks.py +++ b/python/tests/test_benchmarks.py @@ -30,7 +30,7 @@ def test_single_node_io(run_cmd, tmp_path, api): if "zarr" in api: zarr = pytest.importorskip("zarr") if not hasattr(zarr.Array, "meta_array"): - pytest.skip("Requires Zarr v2.13.0+ for CuPy support") + pytest.skip("requires Zarr v2.13+") retcode = run_cmd( cmd=[ diff --git a/python/tests/test_zarr.py b/python/tests/test_zarr.py index 757c2bd22a..e946e075df 100644 --- a/python/tests/test_zarr.py +++ b/python/tests/test_zarr.py @@ -8,11 +8,11 @@ zarr = pytest.importorskip("zarr") GDSStore = pytest.importorskip("kvikio.zarr").GDSStore - -cupy_support = pytest.mark.skipif( - not hasattr(zarr.Array, "meta_array"), - reason="Requires Zarr v2.13.0+ for CuPy support", -) +# To support CuPy arrays, we need the `meta_array` argument introduced +# in Zarr v2.13 +# See +if not hasattr(zarr.Array, "meta_array"): + pytest.skip("requires Zarr v2.13+", allow_module_level=True) @pytest.fixture @@ -35,7 +35,6 @@ def test_direct_store_access(store, array_type): cupy.testing.assert_array_equal(a, b) -@cupy_support def test_array(store): """Test Zarr array""" @@ -49,7 +48,6 @@ def test_array(store): cupy.testing.assert_array_equal(a, z[:]) -@cupy_support def test_group(store): """Test Zarr group"""