diff --git a/src/zarr/core/metadata/v2.py b/src/zarr/core/metadata/v2.py index 3204543426..dd3ce32194 100644 --- a/src/zarr/core/metadata/v2.py +++ b/src/zarr/core/metadata/v2.py @@ -265,11 +265,10 @@ def parse_filters(data: object) -> tuple[Numcodec, ...] | None: """ Parse a potential tuple of filters """ - out: list[Numcodec] = [] - if data is None: return data if isinstance(data, Iterable): + out: list[Numcodec] = [] for idx, val in enumerate(data): if _is_numcodec(val): out.append(val) diff --git a/tests/conftest.py b/tests/conftest.py index 839be34e01..16515829cc 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -118,7 +118,7 @@ async def store2(request: pytest.FixtureRequest, tmpdir: LEGACY_PATH) -> Store: def sync_store(request: pytest.FixtureRequest, tmp_path: LEGACY_PATH) -> Store: result = sync(parse_store(request.param, str(tmp_path))) if not isinstance(result, Store): - raise TypeError("Wrong store class returned by test fixture! got " + result + " instead") + raise TypeError(f"Wrong store class returned by test fixture! got {result} instead") return result diff --git a/tests/test_codec_entrypoints.py b/tests/test_codec_entrypoints.py index e1ef027dd4..f894597148 100644 --- a/tests/test_codec_entrypoints.py +++ b/tests/test_codec_entrypoints.py @@ -25,7 +25,7 @@ def set_path() -> Generator[None, None, None]: @pytest.mark.usefixtures("set_path") @pytest.mark.parametrize("codec_name", ["TestEntrypointCodec", "TestEntrypointGroup.Codec"]) def test_entrypoint_codec(codec_name: str) -> None: - config.set({"codecs.test": "package_with_entrypoint." + codec_name}) + config.set({"codecs.test": f"package_with_entrypoint.{codec_name}"}) cls_test = zarr.registry.get_codec_class("test") assert cls_test.__qualname__ == codec_name @@ -42,7 +42,7 @@ def test_entrypoint_pipeline() -> None: def test_entrypoint_buffer(buffer_name: str) -> None: config.set( { - "buffer": "package_with_entrypoint." + buffer_name, + "buffer": f"package_with_entrypoint.{buffer_name}", "ndbuffer": "package_with_entrypoint.TestEntrypointNDBuffer", } ) diff --git a/tests/test_properties.py b/tests/test_properties.py index 705cfd1b59..8812229812 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -10,6 +10,8 @@ pytest.importorskip("hypothesis") +from itertools import starmap + import hypothesis.extra.numpy as npst import hypothesis.strategies as st from hypothesis import assume, given, settings @@ -60,7 +62,7 @@ def deep_equal(a: Any, b: Any) -> bool: if isinstance(a, np.ndarray) and isinstance(b, np.ndarray): if a.shape != b.shape: return False - return all(deep_equal(x, y) for x, y in zip(a.flat, b.flat, strict=False)) + return all(starmap(deep_equal, zip(a.flat, b.flat, strict=False))) if isinstance(a, dict) and isinstance(b, dict): if set(a.keys()) != set(b.keys()): @@ -70,7 +72,7 @@ def deep_equal(a: Any, b: Any) -> bool: if isinstance(a, (list, tuple)) and isinstance(b, (list, tuple)): if len(a) != len(b): return False - return all(deep_equal(x, y) for x, y in zip(a, b, strict=False)) + return all(starmap(deep_equal, zip(a, b, strict=False))) return a == b