[pyfai] 02/02: do not run the peak_peaker test is python-qt4 is not available

Frédéric-Emmanuel Picca picca at moszumanska.debian.org
Mon Oct 20 14:57:23 UTC 2014


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

picca pushed a commit to branch experimental
in repository pyfai.

commit 68d64f572116919ca915b4f37990d60a3194704f
Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
Date:   Mon Oct 20 16:45:14 2014 +0200

    do not run the peak_peaker test is python-qt4 is not available
    
    This allow also to run the test without DISPLAY
---
 ...r-upstream-skip-test-if-QT4-not-available.patch | 38 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 39 insertions(+)

diff --git a/debian/patches/0002-fix-for-upstream-skip-test-if-QT4-not-available.patch b/debian/patches/0002-fix-for-upstream-skip-test-if-QT4-not-available.patch
new file mode 100644
index 0000000..2712b83
--- /dev/null
+++ b/debian/patches/0002-fix-for-upstream-skip-test-if-QT4-not-available.patch
@@ -0,0 +1,38 @@
+From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?=
+ <picca at synchrotron-soleil.fr>
+Date: Mon, 20 Oct 2014 16:44:30 +0200
+Subject: fix for upstream skip test if QT4 not available
+
+---
+ test/test_peak_picking.py | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/test/test_peak_picking.py b/test/test_peak_picking.py
+index 59e635f..f075c9b 100755
+--- a/test/test_peak_picking.py
++++ b/test/test_peak_picking.py
+@@ -41,15 +41,22 @@ import fabio
+ from utilstest import UtilsTest, Rwp, getLogger
+ logger = getLogger(__file__)
+ pyFAI = sys.modules["pyFAI"]
+-import pyFAI.peak_picker
++
++NO_PEAK_PICKER = false
++try:
++    import pyFAI.peak_picker
++    from pyFAI.peak_picker import PeakPicker
++except ImportError:
++    NO_PEAK_PICKER = True
++
+ import pyFAI.geometryRefinement
+-from pyFAI.peak_picker import PeakPicker
+ from pyFAI.calibrant import Calibrant
+ from pyFAI.geometryRefinement import GeometryRefinement
+ if logger.getEffectiveLevel() <= logging.INFO:
+     import pylab
+ 
+ 
++ at unittest.skipIf(NO_PEAK_PICKER, "cannot import peak_peaker")
+ class test_peak_picking(unittest.TestCase):
+     """basic test"""
+     calibFile = "1788/moke.tif"
diff --git a/debian/patches/series b/debian/patches/series
index 49ea2f4..589bb7c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001-fix-for-upstream-histogram-build-when-.c-file-is-mis.patch
+0002-fix-for-upstream-skip-test-if-QT4-not-available.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyfai.git



More information about the debian-science-commits mailing list