Skip to content

Commit 81f5df3

Browse files
Add slow_wasm marker, skip orthogonal indexing tests
1 parent da8bfc7 commit 81f5df3

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ filterwarnings = [
417417
markers = [
418418
"gpu: mark a test as requiring CuPy and GPU",
419419
"slow_hypothesis: slow hypothesis tests",
420+
"slow_wasm: slow tests in Pyodide/WASM",
420421
]
421422

422423
[tool.repo-review]

tests/conftest.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from hypothesis import HealthCheck, Verbosity, settings
1111

1212
from zarr import AsyncGroup, config
13+
from zarr._constants import IS_WASM
1314
from zarr.abc.store import Store
1415
from zarr.codecs.sharding import ShardingCodec, ShardingCodecIndexLocation
1516
from zarr.core.array import (
@@ -176,15 +177,30 @@ def pytest_addoption(parser: Any) -> None:
176177
default=False,
177178
help="run slow hypothesis tests",
178179
)
180+
parser.addoption(
181+
"--run-slow-wasm",
182+
action="store_true",
183+
default=False,
184+
help="run slow tests only applicable to WASM",
185+
)
179186

180187

181188
def pytest_collection_modifyitems(config: Any, items: Any) -> None:
182189
if config.getoption("--run-slow-hypothesis"):
183190
return
191+
if config.getoption("--run-slow-wasm") and IS_WASM:
192+
return
193+
184194
skip_slow_hyp = pytest.mark.skip(reason="need --run-slow-hypothesis option to run")
195+
skip_slow_wasm = pytest.mark.skip(
196+
reason="need --run-slow-wasm option to run, or not running in WASM"
197+
)
198+
185199
for item in items:
186200
if "slow_hypothesis" in item.keywords:
187201
item.add_marker(skip_slow_hyp)
202+
if "slow_wasm" in item.keywords and not IS_WASM:
203+
item.add_marker(skip_slow_wasm)
188204

189205

190206
settings.register_profile(

tests/test_indexing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,7 @@ def _test_set_orthogonal_selection_2d(
866866
_test_set_orthogonal_selection(v, a, z, selection)
867867

868868

869+
@pytest.mark.slow_wasm
869870
def test_set_orthogonal_selection_2d(store: StorePath) -> None:
870871
# setup
871872
v = np.arange(10000, dtype=int).reshape(1000, 10)
@@ -928,6 +929,7 @@ def _test_set_orthogonal_selection_3d(
928929
_test_set_orthogonal_selection(v, a, z, selection)
929930

930931

932+
@pytest.mark.slow_wasm
931933
def test_set_orthogonal_selection_3d(store: StorePath) -> None:
932934
# setup
933935
v = np.arange(100000, dtype=int).reshape(200, 50, 10)

0 commit comments

Comments
 (0)