[PATCH 5/6] Use the Setuptools script for Debian build-time test.

Ben Finney bignose at debian.org
Fri Jan 13 23:28:45 UTC 2017


This removes the dependency on third-party ‘nose’.

Test suite discovery was added to Python 2's ‘unittest’ in version
2.7. Our test suite already requires Python 2 >= 2.7 so no further
dependencies are needed.
---
 debian/changelog |  3 +++
 debian/control   |  2 --
 debian/rules     | 10 +++++-----
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f6a31110..882c9205 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ python-debian (0.1.30) UNRELEASED; urgency=medium
   [ Ben Finney ]
 
   * Teach the Setuptools script how to find and run the test suite.
+  * Use the Setuptools script for Debian build-time test.
+    Remove ‘python-nose’ dependency, no longer needed.
+    Closes: bug#851324.
 
  --
 
diff --git a/debian/control b/debian/control
index 9528b288..dc51b0d9 100644
--- a/debian/control
+++ b/debian/control
@@ -17,13 +17,11 @@ Build-Depends:
  python-all (>= 2.6.6-3~),
  python-apt (>> 1.1~),
  python-chardet,
- python-nose,
  python-setuptools,
  python-six (>> 1.4~),
  python3-all (>= 3.1.2-8~),
  python3-apt (>> 1.1~),
  python3-chardet,
- python3-nose,
  python3-setuptools,
  python3-six (>> 1.4~)
 Standards-Version: 3.9.8
diff --git a/debian/rules b/debian/rules
index 05ae4737..800e777a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,15 +22,15 @@ override_dh_auto_build: setup.py
 	dh_auto_build
 	lib/debian/doc-debtags > README.debtags
 
-override_dh_auto_test:
+override_dh_auto_test: setup.py
         # don't run the tests if suppressed with DEB_BUILD_OPTIONS=nocheck
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	# run all the tests with both a UTF-8 aware locale and a non-UTF-8
 	# aware locale to catch errors related to encoding.
-	LC_ALL=C nosetests --verbose --exe --where tests
-	LC_ALL=C.UTF-8 nosetests --verbose --exe --where tests
-	LC_ALL=C nosetests3 --verbose --exe --where tests
-	LC_ALL=C.UTF-8 nosetests3 --verbose --exe --where tests
+	LC_ALL=C python2.7 ./setup.py test
+	LC_ALL=C.UTF-8 python2.7 ./setup.py test
+	LC_ALL=C python3 ./setup.py test
+	LC_ALL=C.UTF-8 python3 ./setup.py test
 endif
 
 override_dh_auto_install:
-- 
2.11.0



More information about the pkg-python-debian-maint mailing list