Skip to content

Commit 23bb2e4

Browse files
committed
test parameterize, match cases
1 parent 39e454a commit 23bb2e4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

numcodecs/pcodec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(
6767

6868
def _get_chunk_config(self):
6969
match self.mode_spec:
70-
case "auto" | None:
70+
case "auto":
7171
mode_spec = ModeSpec.auto()
7272
case "classic":
7373
mode_spec = ModeSpec.classic()

numcodecs/tests/test_pcodec.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ def test_config():
6060
check_config(codec)
6161

6262

63-
def test_invalid_config_error():
64-
for param in ["mode_spec", "delta_spec", "paging_spec"]:
65-
codec = PCodec(**{param: "bogus"})
66-
with pytest.raises(ValueError):
67-
check_encode_decode_array_to_bytes(arrays[0], codec)
63+
@pytest.mark.parametrize("param", ["mode_spec", "delta_spec", "paging_spec"])
64+
def test_invalid_config_error(param):
65+
codec = PCodec(**{param: "bogus"})
66+
with pytest.raises(ValueError):
67+
check_encode_decode_array_to_bytes(arrays[0], codec)
6868

6969

7070
def test_invalid_delta_encoding_combo():

0 commit comments

Comments
 (0)