From 7ae9a975bf42e13a327732ef52b8275ea314a7d0 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Tue, 28 May 2024 02:14:47 +0530 Subject: [PATCH] Skip tests that require `dbm` --- tests/v2/test_core.py | 4 ++++ tests/v2/test_hierarchy.py | 4 ++++ tests/v2/test_storage.py | 3 +++ 3 files changed, 11 insertions(+) diff --git a/tests/v2/test_core.py b/tests/v2/test_core.py index 75222893bb..976dbccfc9 100644 --- a/tests/v2/test_core.py +++ b/tests/v2/test_core.py @@ -65,6 +65,8 @@ from zarr.v2.util import buffer_size from .util import abs_container, skip_test_env_var, have_fsspec, mktemp +from tests._shared import IS_WASM + # noinspection PyMethodMayBeStatic @@ -1992,6 +1994,7 @@ def create_store(self): return store +@pytest.mark.skipif(IS_WASM, reason="no dbm support in WASM") class TestArrayWithDBMStore(TestArray): def create_store(self): path = mktemp(suffix=".anydbm") @@ -2003,6 +2006,7 @@ def test_nbytes_stored(self): pass # not implemented +@pytest.mark.skipif(IS_WASM, reason="no dbm support in WASM") @pytest.mark.skip(reason="can't get bsddb3 to work on CI right now") class TestArrayWithDBMStoreBerkeleyDB(TestArray): def create_store(self): diff --git a/tests/v2/test_hierarchy.py b/tests/v2/test_hierarchy.py index 23c5a56edf..31553242f9 100644 --- a/tests/v2/test_hierarchy.py +++ b/tests/v2/test_hierarchy.py @@ -45,6 +45,8 @@ from zarr.v2.util import InfoReporter from .util import skip_test_env_var, have_fsspec, abs_container, mktemp +from tests._shared import IS_WASM + # noinspection PyStatementEffect @@ -1122,6 +1124,7 @@ def test_move(self): pass +@pytest.mark.skipif(IS_WASM, reason="dbm not available in WASM") class TestGroupWithDBMStore(TestGroup): @staticmethod def create_store(): @@ -1131,6 +1134,7 @@ def create_store(): return store, None +@pytest.mark.skipif(IS_WASM, reason="dbm not available in WASM") class TestGroupWithDBMStoreBerkeleyDB(TestGroup): @staticmethod def create_store(): diff --git a/tests/v2/test_storage.py b/tests/v2/test_storage.py index 17b80e6a5c..6e49c09cf2 100644 --- a/tests/v2/test_storage.py +++ b/tests/v2/test_storage.py @@ -59,6 +59,7 @@ from .util import CountingDict, have_fsspec, skip_test_env_var, abs_container, mktemp from zarr.v2.util import ConstantMap, json_dumps +from tests._shared import IS_WASM @contextmanager def does_not_raise(): @@ -1765,6 +1766,7 @@ def test_store_and_retrieve_ndarray(self): assert np.array_equiv(y, x) +@pytest.mark.skipif(IS_WASM, reason="dbm not available in WASM") class TestDBMStore(StoreTests): def create_store(self, dimension_separator=None): path = mktemp(suffix=".anydbm") @@ -1780,6 +1782,7 @@ def test_context_manager(self): assert 2 == len(store) +@pytest.mark.skipif(IS_WASM, reason="dbm not available in WASM") class TestDBMStoreDumb(TestDBMStore): def create_store(self, **kwargs): path = mktemp(suffix=".dumbdbm")