[PATCH] test_compression_diskfile_kwargs: support both RICE_ONE and RICE_1 (#491)
authorAurelien Jarno <aurelien@aurel32.net>
Sun, 3 May 2026 01:45:10 +0000 (03:45 +0200)
committerAurelien Jarno <aurel32@debian.org>
Sun, 10 May 2026 14:22:37 +0000 (16:22 +0200)
Starting with CFITSIO 4.6.4, commit 7d854ef29a4c ("Stop writing RICE_ONE
as an alias for RICE_1."), the ZCMPTYPE header returns RICE_1 instead of
RICE_ONE, breaking the test_compression_diskfile_kwargs test. Update it
to accept both values to maintain compatibility across CFITSIO versions.

Gbp-Pq: Name test_compression_diskfile_kwargs-support-both-RICE_O.patch

fitsio/tests/test_image_compression_defaults.py

index c7ee03ed22acedeff8b74691144836e459c19d40..c927be3e7a76327799a85bc78bb160896f385c95 100644 (file)
@@ -37,9 +37,10 @@ def test_compression_diskfile_kwargs():
             ('ZTILE2', 10),
             ('ZQUANTIZ', 'SUBTRACTIVE_DITHER_2'),
             ('ZDITHER0', 42),
-            ('ZCMPTYPE', 'RICE_ONE'),
         ]:
             assert hdr[key] == val
+        # Starting with cfitsio 4.6.4, RICE_1 is returned instead of RICE_ONE
+        assert hdr['ZCMPTYPE'] in ('RICE_ONE', 'RICE_1')
 
 
 def test_compression_efns():