Skip to content

Commit

Permalink
Try to run tests without async
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed May 27, 2024
1 parent d465742 commit cdf0bb2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
source .venv-pyodide/bin/activate
python -m pip install dist/*.whl
python -m pip install pytest pytest-cov
python -m pytest -v --cov=zarr --cov-config=pyproject.toml zarr
python -m pytest -v --cov=zarr --cov-config=pyproject.toml
- name: Upload Pyodide wheel artifact for debugging
# FIXME: Remove after this is ready to merge
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ minversion = "7"
testpaths = ["tests"]
log_cli_level = "INFO"
xfail_strict = true
asyncio_mode = "auto"
# asyncio_mode = "auto"
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"ELLIPSIS",
Expand Down
16 changes: 16 additions & 0 deletions tests/v3/_shared.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# A common file that can be used to add constants, functions,
# convenience classes, etc. that are shared across multiple tests

import platform
import sys

import pytest

IS_WASM = sys.platform == "emscripten" or platform.machine() in ["wasm32", "wasm64"]


def asyncio_tests_wrapper(func):
if IS_WASM:
return func
else:
return pytest.mark.asyncio(func)
5 changes: 3 additions & 2 deletions tests/v3/test_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

import numpy as np
import numpy.typing as npt
import pytest

from zarr.array import AsyncArray
from zarr.buffer import ArrayLike, NDArrayLike, NDBuffer

from ._shared import asyncio_tests_wrapper

if TYPE_CHECKING:
from typing_extensions import Self

Expand Down Expand Up @@ -45,7 +46,7 @@ def test_nd_array_like(xp):
assert isinstance(ary, NDArrayLike)


@pytest.mark.asyncio
@asyncio_tests_wrapper
async def test_async_array_factory(store_path):
expect = np.zeros((9, 9), dtype="uint16", order="F")
a = await AsyncArray.create(
Expand Down

0 comments on commit cdf0bb2

Please sign in to comment.