[Python-modules-commits] r20026 - in packages/musicbrainzngs/trunk/debian (6 files)

laarmen-guest at users.alioth.debian.org laarmen-guest at users.alioth.debian.org
Sun Jan 15 18:01:03 UTC 2012


    Date: Sunday, January 15, 2012 @ 18:01:01
  Author: laarmen-guest
Revision: 20026

Fix tests for Python 2.6 and enable them in debian/rules

Added:
  packages/musicbrainzngs/trunk/debian/patches/
  packages/musicbrainzngs/trunk/debian/patches/series
  packages/musicbrainzngs/trunk/debian/patches/unittest2.patch
Modified:
  packages/musicbrainzngs/trunk/debian/changelog
  packages/musicbrainzngs/trunk/debian/control
  packages/musicbrainzngs/trunk/debian/rules

Modified: packages/musicbrainzngs/trunk/debian/changelog
===================================================================
--- packages/musicbrainzngs/trunk/debian/changelog	2012-01-15 17:26:25 UTC (rev 20025)
+++ packages/musicbrainzngs/trunk/debian/changelog	2012-01-15 18:01:01 UTC (rev 20026)
@@ -1,5 +1,6 @@
 musicbrainzngs (0.1-1) UNRELEASED; urgency=low
 
   * Initial release (Closes: #655973)
+  * Add patch unittest2.patch to fix the tests with Python 2.6
 
- -- Simon Chopin <chopin.simon at gmail.com>  Sun, 15 Jan 2012 15:58:57 +0100
+ -- Simon Chopin <chopin.simon at gmail.com>  Sun, 15 Jan 2012 18:58:21 +0100

Modified: packages/musicbrainzngs/trunk/debian/control
===================================================================
--- packages/musicbrainzngs/trunk/debian/control	2012-01-15 17:26:25 UTC (rev 20025)
+++ packages/musicbrainzngs/trunk/debian/control	2012-01-15 18:01:01 UTC (rev 20026)
@@ -5,7 +5,8 @@
 Uploaders: Simon Chopin <chopin.simon at gmail.com>
 Build-Depends:
  debhelper (>= 8.0.0),
- python-all (>= 2.6.6-3~)
+ python-all (>= 2.6.6-3~),
+ python-unittest2
 X-Python-Version: >=2.6
 Standards-Version: 3.9.2
 Homepage: https://github.com/alastair/python-musicbrainz-ngs/

Added: packages/musicbrainzngs/trunk/debian/patches/series
===================================================================
--- packages/musicbrainzngs/trunk/debian/patches/series	                        (rev 0)
+++ packages/musicbrainzngs/trunk/debian/patches/series	2012-01-15 18:01:01 UTC (rev 20026)
@@ -0,0 +1 @@
+unittest2.patch

Added: packages/musicbrainzngs/trunk/debian/patches/unittest2.patch
===================================================================
--- packages/musicbrainzngs/trunk/debian/patches/unittest2.patch	                        (rev 0)
+++ packages/musicbrainzngs/trunk/debian/patches/unittest2.patch	2012-01-15 18:01:01 UTC (rev 20026)
@@ -0,0 +1,34 @@
+Description: Use unittest2 in the tests when Python < 2.7
+ So far, while musicbrainzngs itself was compatible with Python 2.6, the
+ unit tests were written using features of unittest introduced by Python
+ 2.7.This patch uses unittest2 instead of the builtin unittest if Python
+ is older that 2.7.
+Author: Simon Chopin <chopin.simon at gmail.com>
+Forwarded: https://github.com/alastair/python-musicbrainz-ngs/pull/34
+
+--- musicbrainzngs-0.1.orig/test/test_requests.py
++++ musicbrainzngs-0.1/test/test_requests.py
+@@ -1,6 +1,9 @@
+-import unittest
+ import os
+ import sys
++if sys.version_info < (2, 7):
++    import unittest2 as unittest
++else:
++    import unittest
+ import time
+ sys.path.append(os.path.abspath(".."))
+ from musicbrainzngs import musicbrainz
+--- musicbrainzngs-0.1.orig/test/test_mbxml.py
++++ musicbrainzngs-0.1/test/test_mbxml.py
+@@ -1,6 +1,9 @@
+-import unittest
+ import os
+ import sys
++if sys.version_info < (2, 7):
++    import unittest2 as unittest
++else:
++    import unittest
+ sys.path.append(os.path.abspath(".."))
+ from musicbrainzngs import mbxml
+ 

Modified: packages/musicbrainzngs/trunk/debian/rules
===================================================================
--- packages/musicbrainzngs/trunk/debian/rules	2012-01-15 17:26:25 UTC (rev 20025)
+++ packages/musicbrainzngs/trunk/debian/rules	2012-01-15 18:01:01 UTC (rev 20026)
@@ -5,3 +5,9 @@
 
 %:
 	dh $@ --with python2
+
+override_dh_auto_test:
+	set -e -x; \
+	for python in $(shell pyversions -r); do \
+		$$python setup.py test; \
+	done




More information about the Python-modules-commits mailing list