Skip to content

Commit 76d6240

Browse files
committed
Add failing test for zarr-developers#2631
1 parent 13fc188 commit 76d6240

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎tests/test_group.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,18 @@ async def test_require_groups(store: LocalStore | MemoryStore, zarr_format: Zarr
11371137
assert no_group == ()
11381138

11391139

1140+
def test_create_dataset_with_data(store: Store, zarr_format: ZarrFormat) -> None:
1141+
"""Check that deprecated create_dataset method allows input data.
1142+
1143+
See https://github.com/zarr-developers/zarr-python/issues/2631.
1144+
"""
1145+
root = Group.from_store(store=store, zarr_format=zarr_format)
1146+
arr = np.random.random((5, 5))
1147+
with pytest.warns(DeprecationWarning):
1148+
data = root.create_dataset("random", data=arr, shape=arr.shape)
1149+
np.testing.assert_array_equal(np.asarray(data), arr)
1150+
1151+
11401152
async def test_create_dataset(store: Store, zarr_format: ZarrFormat) -> None:
11411153
root = await AsyncGroup.from_store(store=store, zarr_format=zarr_format)
11421154
with pytest.warns(DeprecationWarning):

0 commit comments

Comments
 (0)