[med-svn] [python-cobra] 09/11: Backport patch from upstream to fix test skipping for unavailable utils

Afif Elghraoui afif-guest at moszumanska.debian.org
Sat Feb 20 09:20:59 UTC 2016


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

afif-guest pushed a commit to branch master
in repository python-cobra.

commit d7f3975a1797ad77a8b946c6620e98f4a1aac0b3
Author: Afif Elghraoui <afif at ghraoui.name>
Date:   Sat Feb 20 00:56:22 2016 -0800

    Backport patch from upstream to fix test skipping for unavailable utils
    
    Tests will otherwise fail at build time because scipy is
    installed without matplotlib.
    See https://github.com/opencobra/cobrapy/issues/224
---
 debian/patches/fix-test-skips.patch | 40 +++++++++++++++++++++++++++++++++++++
 debian/patches/series               |  1 +
 2 files changed, 41 insertions(+)

diff --git a/debian/patches/fix-test-skips.patch b/debian/patches/fix-test-skips.patch
new file mode 100644
index 0000000..4141095
--- /dev/null
+++ b/debian/patches/fix-test-skips.patch
@@ -0,0 +1,40 @@
+From 2ddffbe26b0f9b4050c4eedf989f99f07fe9def4 Mon Sep 17 00:00:00 2001
+From: Ali Ebrahim <aebrahim at ucsd.edu>
+Date: Tue, 16 Feb 2016 15:13:45 -0800
+Subject: [PATCH] fix minor bug when skipping tests
+
+---
+ cobra/test/flux_analysis.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/cobra/test/flux_analysis.py b/cobra/test/flux_analysis.py
+index 4103cf0..0ba8cf1 100644
+--- a/cobra/test/flux_analysis.py
++++ b/cobra/test/flux_analysis.py
+@@ -173,7 +173,7 @@ def test_loopless(self):
+         try:
+             solver = get_solver_name(mip=True)
+         except:
+-            self.skip("no MILP solver found")
++            self.skipTest("no MILP solver found")
+         test_model = Model()
+         test_model.add_metabolites(Metabolite("A"))
+         test_model.add_metabolites(Metabolite("B"))
+@@ -203,7 +203,7 @@ def test_gapfilling(self):
+         try:
+             solver = get_solver_name(mip=True)
+         except:
+-            self.skip("no MILP solver found")
++            self.skipTest("no MILP solver found")
+         m = Model()
+         m.add_metabolites(map(Metabolite, ["a", "b", "c"]))
+         r = Reaction("EX_A")
+@@ -247,7 +247,7 @@ def test_phenotype_phase_plane(self):
+         self.assertAlmostEqual(data.growth_rates.max(), 1.20898, places=4)
+         self.assertAlmostEqual(abs(data.growth_rates[0, :]).max(), 0, places=4)
+         if matplotlib is None:
+-            self.skip("can't test plots without matplotlib")
++            self.skipTest("can't test plots without matplotlib")
+         data.plot()
+ 
+ # make a test suite to run all of the tests
diff --git a/debian/patches/series b/debian/patches/series
index d86c913..6b820bd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 mathjax.patch
+fix-test-skips.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-cobra.git



More information about the debian-med-commit mailing list