Skip to content

Commit

Permalink
silence ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Sep 27, 2024
1 parent 2fde481 commit 5cba96f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions icechunk-python/tests/test_zarr/test_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from numpy.testing import assert_array_equal
from zarr.core.sync import sync

pytest.importorskip("hypothesis")

import hypothesis.extra.numpy as npst # noqa
Expand All @@ -11,16 +12,18 @@
from zarr.testing.strategies import arrays, np_arrays, basic_indices # noqa
from icechunk import IcechunkStore, Storage

icechunk_stores = st.builds(IcechunkStore.open,
storage=st.builds(Storage.memory),
mode=st.just("w")).map(lambda x: sync(x))
icechunk_stores = st.builds(
IcechunkStore.open, storage=st.builds(Storage.memory), mode=st.just("w")
).map(lambda x: sync(x))

from hypothesis import settings


@settings(report_multiple_bugs=False)
@given(st.data())
def test_roundtrip(data: st.DataObject) -> None:
nparray = data.draw(np_arrays.filter(lambda x: x.dtype.kind != "M" and ">" not in x.dtype.str))
zarray = data.draw(arrays(stores=icechunk_stores,
arrays=st.just(nparray)))
nparray = data.draw(
np_arrays.filter(lambda x: x.dtype.kind != "M" and ">" not in x.dtype.str)
)
zarray = data.draw(arrays(stores=icechunk_stores, arrays=st.just(nparray)))
assert_array_equal(nparray, zarray[:])

0 comments on commit 5cba96f

Please sign in to comment.