summaryrefslogtreecommitdiff
blob: d4a8fa072c5d699670c6b5779d90abaf6f2cc95f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Author: Ole Streicher <olebole@debian.org>
Description: Make TFORMx check more flexible
 The maximal column length in cfitsio changed between version 3370 and 3380.
 This patch checks their syntax, without a specific length.
Bug: https://github.com/astropy/astropy/issues/4646
--- a/astropy/io/fits/tests/test_image.py
+++ b/astropy/io/fits/tests/test_image.py
@@ -4,6 +4,7 @@
 
 import math
 import os
+import re
 import time
 import warnings
 
@@ -1010,7 +1011,7 @@
         hdu.writeto(self.temp('test.fits'))
 
         with fits.open(self.temp('test.fits')) as hdul:
-            assert (hdul['SCI'].data == cube).all()
+            assert np.abs(hdul['SCI'].data - cube).max() < 1./15.
 
     def test_subtractive_dither_seed(self):
         """
@@ -1265,8 +1266,8 @@
 
         with fits.open(self.temp('test.fits'),
                        disable_image_compression=True) as h:
-            assert h[1].header['TFORM1'] == '1PB(30)'
-            assert h[1].header['TFORM2'] == '1PB(359)'
+            assert re.match(r'^1PB\(\d+\)$', h[1].header['TFORM1'])
+            assert re.match(r'^1PB\(\d+\)$', h[1].header['TFORM2'])
 
     def test_compression_update_header(self):
         """Regression test for