[med-svn] [python-cobra] 07/10: Configure autopkgtests

Afif Elghraoui afif-guest at moszumanska.debian.org
Mon Aug 10 09:26:16 UTC 2015


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 d6ea8b36047b4ab5b0609a1befac92a3a56a7fc7
Author: Afif Elghraoui <afif at ghraoui.name>
Date:   Mon Aug 10 02:12:53 2015 -0700

    Configure autopkgtests
---
 debian/patches/series                       |  1 +
 debian/patches/test-suite-return-code.patch | 24 ++++++++++++++++++++++++
 debian/tests/control                        |  7 +++++++
 3 files changed, 32 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index d86c913..8528e9f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 mathjax.patch
+test-suite-return-code.patch
diff --git a/debian/patches/test-suite-return-code.patch b/debian/patches/test-suite-return-code.patch
new file mode 100644
index 0000000..c1f91bf
--- /dev/null
+++ b/debian/patches/test-suite-return-code.patch
@@ -0,0 +1,24 @@
+Description: Pass test suite exit status back to the shell
+ Watching stderr is not reliable since warnings are also printed there.
+ Barring that, the test suite did not pass its exit status back to the
+ shell and there was no way to automatically check whether the tests were
+ successful.
+Author: Afif Elghraoui <afif at ghraoui.name>
+Forwarded: no
+Last-Update: 2015-08-10
+--- python-cobra.orig/cobra/test/__init__.py
++++ python-cobra/cobra/test/__init__.py
+@@ -1,5 +1,6 @@
+ from __future__ import absolute_import
+ from os.path import join, abspath, dirname
++import sys
+ import unittest as _unittest
+ 
+ try:
+@@ -63,4 +64,5 @@
+ 
+ def test_all():
+     """###running unit tests on cobra py###"""
+-    _unittest.TextTestRunner(verbosity=2).run(create_test_suite())
++    status = not _unittest.TextTestRunner(verbosity=2).run(create_test_suite()).wasSuccessful()
++    sys.exit(status)
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..d61afd9
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,7 @@
+Test-Command: python -c "from cobra.test import test_all; test_all()"
+Depends: python-cobra, python-cobra-data
+Restrictions: allow-stderr, needs-recommends
+
+Test-Command: python3 -c "from cobra.test import test_all; test_all()"
+Depends: python3-cobra, python-cobra-data
+Restrictions: allow-stderr, needs-recommends

-- 
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