Skip to content

Commit d1c37a3

Browse files
committed
test coverage
1 parent ec07100 commit d1c37a3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/zarr/codecs/gpu.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ def to_dict(self) -> dict[str, JSON]:
7272

7373
@cached_property
7474
def _zstd_codec(self) -> nvcomp.Codec:
75-
# config_dict = {algorithm = "Zstd", "level": self.level, "checksum": self.checksum}
76-
# return Zstd.from_config(config_dict)
7775
device = cp.cuda.Device() # Select the current default device
7876
stream = cp.cuda.get_current_stream() # Use the current default stream
7977
return nvcomp.Codec(

tests/test_codecs/test_nvcomp.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,14 @@ def test_nvcomp_zstd(store: Store, checksum: bool) -> None:
3232

3333
a[:, :] = data
3434
cp.testing.assert_array_equal(data, a[:, :])
35+
36+
37+
def test_invalid_raises() -> None:
38+
with pytest.raises(ValueError):
39+
NvcompZstdCodec(level=100, checksum=False)
40+
41+
with pytest.raises(TypeError):
42+
NvcompZstdCodec(level="100", checksum=False) # type: ignore[arg-type]
43+
44+
with pytest.raises(TypeError):
45+
NvcompZstdCodec(checksum="False") # type: ignore[arg-type]

0 commit comments

Comments
 (0)