[Debian-astro-commits] [python-astropy] 04/05: Fix cfitsio related tests. Closes: #816715

Ole Streicher olebole at moszumanska.debian.org
Fri Mar 11 10:17:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

olebole pushed a commit to branch debian
in repository python-astropy.

commit 938d2f26a1b3ea54042aeb6cf91b5560b30fce57
Author: Ole Streicher <ole at aip.de>
Date:   Fri Mar 11 10:55:32 2016 +0100

    Fix cfitsio related tests. Closes: #816715
---
 debian/changelog                          |  1 +
 debian/patches/fix_for_cfitsio_3380.patch | 35 +++++++++++++++++++++++++++++++
 debian/patches/series                     |  1 +
 3 files changed, 37 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index cf5a2a0..47f90d1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ python-astropy (1.1.2-1) UNRELEASED; urgency=low
 
   * Add ASCL-Id
   * New upstream version
+  * Fix cfitsio related tests. Closes: #816715
 
  -- Ole Streicher <olebole at debian.org>  Fri, 11 Mar 2016 10:36:51 +0100
 
diff --git a/debian/patches/fix_for_cfitsio_3380.patch b/debian/patches/fix_for_cfitsio_3380.patch
new file mode 100644
index 0000000..d4a8fa0
--- /dev/null
+++ b/debian/patches/fix_for_cfitsio_3380.patch
@@ -0,0 +1,35 @@
+Author: Ole Streicher <olebole at 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
diff --git a/debian/patches/series b/debian/patches/series
index 04aaa11..5dd23ef 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 mark_known_failures.patch
 disable_helper.patch
 fix_for_pytest_2.8.patch
+fix_for_cfitsio_3380.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/python-astropy.git



More information about the Debian-astro-commits mailing list