Skip to content

Commit 4366ec1

Browse files
benjefferyjeromekelleher
authored andcommitted
Fix tests for new numcodecs
1 parent 0768962 commit 4366ec1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tests/test_icf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ def test_empty_chunk_file(self, tmp_path):
402402
with pytest.raises(RuntimeError, match="blosc"):
403403
icf["POS"].values # noqa B018
404404

405-
# Chunk file is 195 long for numpy v1, and 193 long for v2
406-
@pytest.mark.parametrize("length", [10, 100, 190, 192])
405+
# Chunk file is 187 long
406+
@pytest.mark.parametrize("length", [10, 100, 185])
407407
def test_truncated_chunk_file(self, tmp_path, length):
408408
icf_path = tmp_path / "icf"
409409
vcf2zarr.explode(icf_path, [self.data_path])

tests/test_vcf_examples.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -959,9 +959,12 @@ def test_split_explode(tmp_path):
959959
vcf2zarr.explode_partition(out, j)
960960
vcf2zarr.explode_finalise(out)
961961
pcvcf = vcf2zarr.IntermediateColumnarFormat(out)
962-
assert pcvcf.fields["POS"].vcf_field.summary.asdict() == {
962+
summary_d = pcvcf.fields["POS"].vcf_field.summary.asdict()
963+
# The compressed size can vary with different numcodecs versions
964+
assert summary_d["compressed_size"] == 571 or summary_d["compressed_size"] == 587
965+
del summary_d["compressed_size"]
966+
assert summary_d == {
963967
"num_chunks": 3,
964-
"compressed_size": 587,
965968
"uncompressed_size": 1008,
966969
"max_number": 1,
967970
"max_value": 1235237,

0 commit comments

Comments
 (0)