[SCM] Control pipeline recipes from the European Southern Observatory branch, debian, updated. upstream/0.3.5.1-57-g6381cbc

Ole Streicher debian at liska.ath.cx
Sat Mar 30 14:06:29 UTC 2013


The following commit has been merged in the debian branch:
commit 6381cbc72cc6889c3b85cb9425ce40dba76f8100
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Sat Mar 30 15:06:23 2013 +0100

    Workaround in tests for older pyfits versions

diff --git a/debian/patches/disable_crash_tests.patch b/debian/patches/disable_crash_tests.patch
index 72f9acb..d9e4890 100644
--- a/debian/patches/disable_crash_tests.patch
+++ b/debian/patches/disable_crash_tests.patch
@@ -6,7 +6,7 @@ Description: On armel, mips and mipsel, the tests that try to crash the recipe
 Forwarded: not-needed
 --- a/test/TestRecipe.py
 +++ b/test/TestRecipe.py
-@@ -509,17 +509,17 @@
+@@ -563,17 +563,17 @@
                           len('9d123996fa9a7bda315d07e063043454'))
  
  class RecipeCrashing(RecipeTestCase):
diff --git a/debian/patches/series b/debian/patches/series
index a410047..ba33221 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
+workaround_pyfits_bug.patch
 set-default-plugin-path.patch
 disable_crash_tests.patch
diff --git a/debian/patches/workaround_pyfits_bug.patch b/debian/patches/workaround_pyfits_bug.patch
new file mode 100644
index 0000000..5d9f34e
--- /dev/null
+++ b/debian/patches/workaround_pyfits_bug.patch
@@ -0,0 +1,334 @@
+Author: Ole Streicher <debian at liska.ath.cx>
+Description: Workaround for older pyfits versions.
+ Older pyfits seem to have the bug that hdulist.close() raises an exception
+ on memory mapped files. This is the case for Ubuntu 12.04. So, for the 
+ test cases, we catch all exceptions on close().
+--- a/test/TestRecipe.py
++++ b/test/TestRecipe.py
+@@ -286,7 +286,10 @@
+         self.assertTrue(isinstance(res.THE_PRO_CATG_VALUE, pyfits.HDUList))
+         self.assertTrue(abs(self.raw_frame[0].data 
+                             - res.THE_PRO_CATG_VALUE[0].data).max() == 0)
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+ 
+     def test_frames_keyword_calib(self):
+         '''Raw frame specified as keyword, calibration frame set in recipe'''
+@@ -295,7 +298,10 @@
+         res = self.recipe({'RRRECIPE_DOCATG_RAW':self.raw_frame})
+         self.assertTrue(isinstance(res, cpl.Result))
+         self.assertTrue(isinstance(res.THE_PRO_CATG_VALUE, pyfits.HDUList))
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+ 
+     def test_frames_tag_keyword(self):
+         '''The 'tag' parameter'''
+@@ -304,7 +310,10 @@
+         res = self.recipe(self.raw_frame, tag = raw_tag)
+         self.assertTrue(isinstance(res, cpl.Result))
+         self.assertTrue(isinstance(res.THE_PRO_CATG_VALUE, pyfits.HDUList))
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+ 
+     def test_frames_tag_attribute(self):
+         '''The 'tag' attribute'''
+@@ -312,7 +321,10 @@
+         res = self.recipe(self.raw_frame)
+         self.assertTrue(isinstance(res, cpl.Result))
+         self.assertTrue(isinstance(res.THE_PRO_CATG_VALUE, pyfits.HDUList))
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+ 
+     def test_frames_one_element_input_list(self):
+         '''Use 1-element list as input'''
+@@ -321,7 +333,10 @@
+         self.assertTrue(isinstance(res, cpl.Result))
+         self.assertFalse(isinstance(res.THE_PRO_CATG_VALUE, pyfits.HDUList))
+         self.assertTrue(isinstance(res.THE_PRO_CATG_VALUE, list))
+-        res.THE_PRO_CATG_VALUE[0].close()
++        try:
++            res.THE_PRO_CATG_VALUE[0].close()
++        except:
++            pass
+ 
+     def test_frames_many_element_input_list(self):
+         '''Use multiple files as input'''
+@@ -330,7 +345,10 @@
+         res = self.recipe([self.raw_frame, self.raw_frame])
+         self.assertTrue(isinstance(res, cpl.Result))
+         self.assertTrue(isinstance(res.THE_PRO_CATG_VALUE, pyfits.HDUList))
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+ 
+     def test_output_dir_attribute(self):
+         '''Write an output dir specified as attribute'''
+@@ -345,7 +363,10 @@
+         self.assertTrue(os.path.isfile(res.THE_PRO_CATG_VALUE))
+         hdu = pyfits.open(res.THE_PRO_CATG_VALUE)
+         self.assertTrue(isinstance(hdu, pyfits.HDUList))
+-        hdu.close()
++        try:
++            hdu.close()
++        except:
++            pass
+ 
+     def test_output_dir_keyword(self):
+         '''Write an output dir specified as call keyword arg'''
+@@ -361,7 +382,10 @@
+         self.assertTrue(os.path.isfile(res.THE_PRO_CATG_VALUE))
+         hdu = pyfits.open(res.THE_PRO_CATG_VALUE)
+         self.assertTrue(isinstance(hdu, pyfits.HDUList))
+-        hdu.close()
++        try:
++            hdu.close()
++        except:
++            pass
+ 
+     def test_param_default(self):
+         '''Test default parameter settings'''
+@@ -378,14 +402,20 @@
+                          self.recipe.param.enumopt.default)
+         self.assertEqual(res[0].header['HIERARCH ESO QC RANGEOPT'],
+                          self.recipe.param.rangeopt.default)
+-        res.close()
++        try:
++            res.close()
++        except:
++            pass
+ 
+     def test_param_keyword_dict(self):
+         '''Parameter handling via keyword dict'''
+         res = self.recipe(self.raw_frame, 
+                           param = { 'stropt':'more' }).THE_PRO_CATG_VALUE
+         self.assertEqual(res[0].header['HIERARCH ESO QC STROPT'], 'more')
+-        res.close()
++        try:
++            res.close()
++        except:
++            pass
+ 
+     def test_param_keyword_dict_wrong(self):
+         '''Parameter handling via keyword dict'''
+@@ -397,17 +427,26 @@
+         self.recipe.param.stropt = 'more'
+         res = self.recipe(self.raw_frame).THE_PRO_CATG_VALUE
+         self.assertEqual(res[0].header['HIERARCH ESO QC STROPT'], 'more')
+-        res.close()
++        try:
++            res.close()
++        except:
++            pass
+ 
+     def test_param_delete(self):
+         '''Delete a parameter in a second run after setting it'''
+         self.recipe.param.intopt = 123
+         res = self.recipe(self.raw_frame).THE_PRO_CATG_VALUE
+-        res.close()
++        try:
++            res.close()
++        except:
++            pass
+         del self.recipe.param.intopt
+         res = self.recipe(self.raw_frame).THE_PRO_CATG_VALUE
+         self.assertEqual(res[0].header['HIERARCH ESO QC INTOPT'], 2)
+-        res.close()
++        try:
++            res.close()
++        except:
++            pass
+ 
+     def test_param_overwrite(self):
+         '''Overwrite the recipe setting param via via keyword arg'''
+@@ -430,21 +469,30 @@
+         self.assertEqual(res[0].header['HIERARCH ESO QC FLOATOPT'], -0.25)
+         self.assertEqual(res[0].header['HIERARCH ESO QC ENUMOPT'], 'third')
+         self.assertEqual(res[0].header['HIERARCH ESO QC RANGEOPT'], 0.125)
+-        res.close()
++        try:
++            res.close()
++        except:
++            pass
+         
+     def test_environment_setting(self):
+         '''Additional environment parameter via recipe setting'''
+         self.recipe.env['TESTENV'] = 'unkk'
+         res = self.recipe(self.raw_frame).THE_PRO_CATG_VALUE
+         self.assertEqual(res[0].header['HIERARCH ESO QC TESTENV'], 'unkk')
+-        res.close()
++        try:
++            res.close()
++        except:
++            pass
+ 
+     def test_environment_keyword(self):
+         '''Additional environment parameter via recipe call keyword'''
+         res = self.recipe(self.raw_frame, 
+                           env = {'TESTENV':'kknu'}).THE_PRO_CATG_VALUE
+         self.assertEqual(res[0].header['HIERARCH ESO QC TESTENV'], 'kknu')
+-        res.close()
++        try:
++            res.close()
++        except:
++            pass
+ 
+     def test_error(self):
+         '''Error handling'''
+@@ -475,7 +523,10 @@
+             # check that the data were moved correctly
+             self.assertTrue(abs(self.raw_frame[0].data 
+                                 - res.THE_PRO_CATG_VALUE[0].data).max() < 1e-6)
+-            res.THE_PRO_CATG_VALUE.close()
++            try:
++                res.THE_PRO_CATG_VALUE.close()
++            except:
++                pass
+ 
+     def test_error_parallel(self):
+         '''Error handling in parallel execution'''
+@@ -491,7 +542,10 @@
+         res = self.recipe(self.raw_frame)
+         key = 'DATAMD5'
+         md5sum = res.THE_PRO_CATG_VALUE[0].header[key]
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+         self.assertNotEqual(md5sum, 'Not computed')
+         self.assertEqual(len(md5sum), 
+                          len('9d123996fa9a7bda315d07e063043454'))
+@@ -503,7 +557,10 @@
+         res = self.recipe(self.raw_frame)
+         key = 'HIERARCH ESO PRO REC1 CAL1 DATAMD5'
+         md5sum = res.THE_PRO_CATG_VALUE[0].header[key]
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+         self.assertNotEqual(md5sum, 'Not computed')
+         self.assertEqual(len(md5sum), 
+                          len('9d123996fa9a7bda315d07e063043454'))
+@@ -534,7 +591,10 @@
+         self.res = self.recipe(self.raw_frame)
+ 
+     def tearDown(self):
+-        self.res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+ 
+     def test_attribute(self):
+         '''The result as an attribute'''
+@@ -671,7 +731,10 @@
+         self.handler.clear()
+         logging.getLogger().setLevel(logging.DEBUG)
+         res = self.recipe(self.raw_frame)
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+ 
+         # check that the logs are not empty
+         self.assertNotEqual(len(self.handler.logs), 0)
+@@ -695,7 +758,10 @@
+         self.handler.clear()
+         logging.getLogger('cpl.rtest').setLevel(logging.INFO)
+         res = self.recipe(self.raw_frame)
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+ 
+         # check that the logs are not empty
+         self.assertNotEqual(len(self.handler.logs), 0)
+@@ -705,7 +771,10 @@
+         self.handler.clear()
+         logging.getLogger('cpl.rtest').setLevel(logging.WARN)
+         res = self.recipe(self.raw_frame)
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+ 
+         # check that the logs are not empty
+         self.assertNotEqual(len(self.handler.logs), 0)
+@@ -716,7 +785,10 @@
+         self.handler.clear()
+         logging.getLogger('cpl.rtest').setLevel(logging.ERROR)
+         res = self.recipe(self.raw_frame)
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+         self.assertEqual(len(self.handler.logs), 0)
+ 
+     def test_logging_common(self):
+@@ -724,7 +796,10 @@
+         self.handler.clear()
+         self.other_handler.clear()
+         res = self.recipe(self.raw_frame, logname = 'othername')
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+         self.assertNotEqual(len(self.other_handler.logs), 0)
+ 
+     def test_logging_multiline(self):
+@@ -732,7 +807,10 @@
+         self.handler.clear()
+         logging.getLogger('cpl.rtest').setLevel(logging.INFO)
+         res = self.recipe(self.raw_frame)
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+         # check that the multi line log sequence appears
+         multiline = 0
+         tag = 'multiline#'
+@@ -763,7 +841,10 @@
+         self.assertTrue(isinstance(res.log.warning[0], str))
+         # Check that there were no error messages
+         self.assertEqual(len(res.log.error), 0)
+-        res.THE_PRO_CATG_VALUE.close()
++        try:
++            res.THE_PRO_CATG_VALUE.close()
++        except:
++            pass
+ 
+     def test_error(self):
+         '''"log" attribute of the CplError object'''
+@@ -805,7 +886,10 @@
+         self.pinfo = cpl.dfs.ProcessingInfo(self.res)
+ 
+     def tearDown(self):
+-        self.res.close()
++        try:
++            self.res.close()
++        except:
++            pass
+ 
+     def test_param(self):
+         '''Parameter information'''

-- 
Control pipeline recipes from the European Southern Observatory



More information about the debian-science-commits mailing list