| 
1 | 1 | import textwrap  | 
2 | 2 | 
 
  | 
 | 3 | +import numpy as np  | 
3 | 4 | import pytest  | 
4 | 5 | 
 
  | 
 | 6 | +from zarr.codecs.bytes import BytesCodec  | 
5 | 7 | from zarr.core._info import ArrayInfo, GroupInfo, human_readable_size  | 
6 | 8 | from zarr.core.common import ZarrFormat  | 
7 | 9 | 
 
  | 
@@ -51,13 +53,13 @@ def test_group_info_complete(zarr_format: ZarrFormat) -> None:  | 
51 | 53 | def test_array_info(zarr_format: ZarrFormat) -> None:  | 
52 | 54 |     info = ArrayInfo(  | 
53 | 55 |         _zarr_format=zarr_format,  | 
54 |  | -        _data_type="int32",  | 
 | 56 | +        _data_type=np.dtype("int32"),  | 
55 | 57 |         _shape=(100, 100),  | 
56 | 58 |         _chunk_shape=(10, 100),  | 
57 | 59 |         _order="C",  | 
58 | 60 |         _read_only=True,  | 
59 | 61 |         _store_type="MemoryStore",  | 
60 |  | -        _codecs="[\"BytesCodec(endian=<Endian.little: 'little'>\"]",  | 
 | 62 | +        _codecs=[BytesCodec()],  | 
61 | 63 |     )  | 
62 | 64 |     result = repr(info)  | 
63 | 65 |     assert result == textwrap.dedent(f"""\  | 
@@ -87,13 +89,13 @@ def test_array_info_complete(  | 
87 | 89 |     ) = bytes_things  | 
88 | 90 |     info = ArrayInfo(  | 
89 | 91 |         _zarr_format=zarr_format,  | 
90 |  | -        _data_type="int32",  | 
 | 92 | +        _data_type=np.dtype("int32"),  | 
91 | 93 |         _shape=(100, 100),  | 
92 | 94 |         _chunk_shape=(10, 100),  | 
93 | 95 |         _order="C",  | 
94 | 96 |         _read_only=True,  | 
95 | 97 |         _store_type="MemoryStore",  | 
96 |  | -        _codecs="[\"BytesCodec(endian=<Endian.little: 'little'>\"]",  | 
 | 98 | +        _codecs=[BytesCodec()],  | 
97 | 99 |         _count_bytes=count_bytes,  | 
98 | 100 |         _count_bytes_stored=count_bytes_stored,  | 
99 | 101 |         _count_chunks_initialized=count_chunks_initialized,  | 
 | 
0 commit comments