From 8df62c5af46d5dab7098b57fab9af66c3d76f0dc Mon Sep 17 00:00:00 2001 From: Ben Jeffery Date: Wed, 17 Jul 2024 01:06:23 +0100 Subject: [PATCH] Fix tests for new numcodecs --- tests/test_icf.py | 4 ++-- tests/test_vcf_examples.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_icf.py b/tests/test_icf.py index 021da85..007340d 100644 --- a/tests/test_icf.py +++ b/tests/test_icf.py @@ -402,8 +402,8 @@ def test_empty_chunk_file(self, tmp_path): with pytest.raises(RuntimeError, match="blosc"): icf["POS"].values # noqa B018 - # Chunk file is 195 long for numpy v1, and 193 long for v2 - @pytest.mark.parametrize("length", [10, 100, 190, 192]) + # Chunk file is 187 long + @pytest.mark.parametrize("length", [10, 100, 185]) def test_truncated_chunk_file(self, tmp_path, length): icf_path = tmp_path / "icf" vcf2zarr.explode(icf_path, [self.data_path]) diff --git a/tests/test_vcf_examples.py b/tests/test_vcf_examples.py index 1165419..80b191c 100644 --- a/tests/test_vcf_examples.py +++ b/tests/test_vcf_examples.py @@ -959,9 +959,12 @@ def test_split_explode(tmp_path): vcf2zarr.explode_partition(out, j) vcf2zarr.explode_finalise(out) pcvcf = vcf2zarr.IntermediateColumnarFormat(out) - assert pcvcf.fields["POS"].vcf_field.summary.asdict() == { + summary_d = pcvcf.fields["POS"].vcf_field.summary.asdict() + # The compressed size can vary with different numcodecs versions + assert summary_d["compressed_size"] == 571 or summary_d["compressed_size"] == 587 + del summary_d["compressed_size"] + assert summary_d == { "num_chunks": 3, - "compressed_size": 587, "uncompressed_size": 1008, "max_number": 1, "max_value": 1235237,