Skip to content

Commit 0454e91

Browse files
tomwhitemergify[bot]
authored andcommitted
Add test for FloatFormatFieldWarning
1 parent a66162d commit 0454e91

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

sgkit/tests/io/vcf/test_vcf_reader.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
partition_into_regions,
1515
vcf_to_zarr,
1616
)
17-
from sgkit.io.vcf.vcf_reader import zarr_array_sizes
17+
from sgkit.io.vcf.vcf_reader import FloatFormatFieldWarning, zarr_array_sizes
1818
from sgkit.tests.io.test_dataset import assert_identical
1919

2020
from .utils import path_for_test
@@ -299,6 +299,20 @@ def test_vcf_to_zarr__parallel_compressor_and_filters(
299299
] # sgkit default
300300

301301

302+
def test_vcf_to_zarr__float_format_field_warning(shared_datadir, tmp_path):
303+
path = path_for_test(shared_datadir, "simple.output.mixed_depth.likelihoods.vcf")
304+
output = tmp_path.joinpath("vcf.zarr").as_posix()
305+
306+
with pytest.warns(FloatFormatFieldWarning):
307+
vcf_to_zarr(
308+
path,
309+
output,
310+
ploidy=4,
311+
max_alt_alleles=3,
312+
fields=["FORMAT/GL"],
313+
)
314+
315+
302316
@pytest.mark.parametrize(
303317
"is_path",
304318
[True, False],

0 commit comments

Comments
 (0)