Skip to content

Commit 0edc39b

Browse files
committed
move v3/tests to tests and fix various mypy issues
1 parent 840a3f7 commit 0edc39b

40 files changed

+24
-16
lines changed

pyproject.toml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -275,18 +275,17 @@ ignore_errors = true
275275

276276
[[tool.mypy.overrides]]
277277
module = [
278-
"tests.v2.*",
279-
"tests.v3.package_with_entrypoint.*",
280-
"tests.v3.test_codecs.test_codecs",
281-
"tests.v3.test_codecs.test_transpose",
282-
"tests.v3.test_metadata.*",
283-
"tests.v3.test_store.*",
284-
"tests.v3.test_config",
285-
"tests.v3.test_group",
286-
"tests.v3.test_indexing",
287-
"tests.v3.test_properties",
288-
"tests.v3.test_sync",
289-
"tests.v3.test_v2",
278+
"tests.package_with_entrypoint.*",
279+
"tests.test_codecs.test_codecs",
280+
"tests.test_codecs.test_transpose",
281+
"tests.test_metadata.*",
282+
"tests.test_store.*",
283+
"tests.test_config",
284+
"tests.test_group",
285+
"tests.test_indexing",
286+
"tests.test_properties",
287+
"tests.test_sync",
288+
"tests.test_v2",
290289
]
291290
ignore_errors = true
292291

src/zarr/testing/utils.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, cast
3+
from collections.abc import Callable, Coroutine
4+
from typing import TYPE_CHECKING, Any, TypeVar, cast
45

56
import pytest
67

@@ -37,8 +38,16 @@ def has_cupy() -> bool:
3738
return False
3839

3940

41+
T_Callable = TypeVar("T_Callable", bound=Callable[[], Coroutine[Any, Any, None]])
42+
43+
4044
# Decorator for GPU tests
41-
def gpu_test(func: Any) -> Any:
42-
return pytest.mark.gpu(
43-
pytest.mark.skipif(not has_cupy(), reason="CuPy not installed or no GPU available")(func)
45+
def gpu_test(func: T_Callable) -> T_Callable:
46+
return cast(
47+
T_Callable,
48+
pytest.mark.gpu(
49+
pytest.mark.skipif(not has_cupy(), reason="CuPy not installed or no GPU available")(
50+
func
51+
)
52+
),
4453
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)