Skip to content

Commit da2f03f

Browse files
committed
fix mypy
1 parent 79a45b1 commit da2f03f

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/zarr/api/asynchronous.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import numpy.typing as npt
1010
from typing_extensions import deprecated
1111

12-
from zarr import config
1312
from zarr.core.array import Array, AsyncArray, create_array, get_array_metadata
1413
from zarr.core.array_spec import ArrayConfig, ArrayConfigLike
1514
from zarr.core.buffer import NDArrayLike
@@ -25,6 +24,7 @@
2524
concurrent_map,
2625
parse_dtype,
2726
)
27+
from zarr.core.config import config
2828
from zarr.core.group import AsyncGroup, ConsolidatedMetadata, GroupMetadata
2929
from zarr.core.metadata import ArrayMetadataDict, ArrayV2Metadata, ArrayV3Metadata
3030
from zarr.core.metadata.v2 import _default_compressor, _default_filters

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ async def store(request: pytest.FixtureRequest, tmpdir: LEGACY_PATH) -> Store:
7878
@pytest.fixture
7979
async def store2(request: pytest.FixtureRequest, tmpdir: LEGACY_PATH) -> Store:
8080
param = request.param
81-
return await parse_store(param, str(tmpdir / "store2"))
81+
store2_path = tmpdir.mkdir("store2")
82+
return await parse_store(param, str(store2_path))
8283

8384

8485
@pytest.fixture(params=["local", "memory", "zip"])

tests/test_array.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
import numcodecs
1010
import numpy as np
1111
import pytest
12-
from numpy.ma.testutils import assert_array_equal
1312

1413
import zarr.api.asynchronous
1514
from zarr import Array, AsyncArray, Group
15+
from zarr.abc.store import Store
1616
from zarr.codecs import (
1717
BytesCodec,
1818
GzipCodec,
@@ -1265,14 +1265,16 @@ async def test_scalar_array() -> None:
12651265
assert arr.shape == ()
12661266

12671267

1268-
@pytest.mark.parametrize("store", ["memory", "local"], indirect=True)
1269-
@pytest.mark.parametrize("store2", ["memory", "local"], indirect=True)
1268+
@pytest.mark.parametrize("store", ["local", "memory", "zip"], indirect=["store"])
1269+
@pytest.mark.parametrize("store2", ["local", "memory", "zip"], indirect=["store2"])
12701270
@pytest.mark.parametrize("src_chunks", [(1, 2), (5, 5), (5, 10)])
12711271
@pytest.mark.parametrize("new_chunks", [(1, 2), (5, 5), (5, 10)])
1272-
async def test_creation_from_other_zarr(store, store2, src_chunks, new_chunks):
1272+
async def test_creation_from_other_zarr(
1273+
store: Store, store2: Store, src_chunks: tuple[int, int], new_chunks: tuple[int, int]
1274+
) -> None:
12731275
src_fill_value = 2
12741276
src_dtype = np.dtype("uint8")
1275-
src_attributes = {}
1277+
src_attributes = None
12761278

12771279
src = zarr.create(
12781280
(10, 10),
@@ -1297,7 +1299,7 @@ async def test_creation_from_other_zarr(store, store2, src_chunks, new_chunks):
12971299
attributes=new_attributes,
12981300
)
12991301

1300-
assert_array_equal(result2[:], src[:])
1302+
np.testing.assert_array_equal(result2[:], src[:])
13011303
assert result2.fill_value == new_fill_value
13021304
assert result2.dtype == new_dtype
13031305
assert result2.attrs == new_attributes

0 commit comments

Comments
 (0)