Skip to content

Commit e4f6670

Browse files
Ignore a doctest that uses threads within the file
1 parent 3e1a968 commit e4f6670

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

numcodecs/zarr3.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@
2424

2525
from __future__ import annotations
2626

27+
# Short workaround for skipping the doctest above in a WASM environment
28+
# compiled via Emscripten where threads are not available, and accessing
29+
# the pytest config has no effect and ignoring warnings does not work.
30+
try:
31+
import pytest
32+
33+
from numcodecs.tests.common import is_wasm
34+
35+
if is_wasm:
36+
pytest.skip("zarr3 doctests not supported in WASM", allow_module_level=True)
37+
except (ImportError, ModuleNotFoundError): # not running tests
38+
pass
39+
2740
import asyncio
2841
import math
2942
from collections.abc import Callable

0 commit comments

Comments
 (0)