Skip to content

Commit dd8afc5

Browse files
committed
codecov
1 parent 77f9e05 commit dd8afc5

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

numcodecs/tests/test_zarr3.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,19 @@ def test_generic_filter_packbits(store: Store):
153153
a = Array.open(store / "generic_packbits")
154154
np.testing.assert_array_equal(data, a[:, :])
155155

156+
with pytest.raises(ValueError, match="packbits filter requires bool dtype"):
157+
Array.create(
158+
store / "generic_packbits_err",
159+
shape=data.shape,
160+
chunk_shape=(16, 16),
161+
dtype="uint32",
162+
fill_value=0,
163+
codecs=[
164+
get_codec_class("numcodecs.packbits")(),
165+
BytesCodec(),
166+
],
167+
)
168+
156169

157170
@pytest.mark.parametrize("codec_id", ["crc32", "adler32", "fletcher32", "jenkins_lookup3"])
158171
def test_generic_checksum(store: Store, codec_id: str):

numcodecs/zarr3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def to_dict(self) -> JSON:
8686
}
8787

8888
def compute_encoded_size(self, input_byte_length: int, chunk_spec: ArraySpec) -> int:
89-
return input_byte_length
89+
return input_byte_length # pragma: no cover
9090

9191

9292
class NumcodecsBytesBytesCodec(NumcodecsCodec, BytesBytesCodec):
@@ -186,7 +186,7 @@ def __init__(self, codec_config: dict[str, JSON] | None = None) -> None:
186186
super().__init__(codec_id=_codec_id, codec_config=codec_config)
187187

188188
def compute_encoded_size(self, input_byte_length: int, chunk_spec: ArraySpec) -> int:
189-
return input_byte_length + 4
189+
return input_byte_length + 4 # pragma: no cover
190190

191191
_ChecksumCodec.__name__ = cls_name
192192
return _ChecksumCodec

0 commit comments

Comments
 (0)