[Python-modules-commits] r17453 - in packages/python-gflags/trunk/debian (3 files)
soren-guest at users.alioth.debian.org
soren-guest at users.alioth.debian.org
Tue Jun 14 13:02:56 UTC 2011
Date: Tuesday, June 14, 2011 @ 13:02:54
Author: soren-guest
Revision: 17453
* New upstream release
* python2.7-testsuite.patch: Make test suite pass with Python 2.7.
Added:
packages/python-gflags/trunk/debian/patches/python2.7-testsuite.patch
Modified:
packages/python-gflags/trunk/debian/changelog
packages/python-gflags/trunk/debian/patches/series
Modified: packages/python-gflags/trunk/debian/changelog
===================================================================
--- packages/python-gflags/trunk/debian/changelog 2011-06-14 11:57:35 UTC (rev 17452)
+++ packages/python-gflags/trunk/debian/changelog 2011-06-14 13:02:54 UTC (rev 17453)
@@ -1,3 +1,10 @@
+python-gflags (1.5.1-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * python2.7-testsuite.patch: Make test suite pass with Python 2.7.
+
+ -- Soren Hansen <soren at ubuntu.com> Tue, 14 Jun 2011 13:58:41 +0200
+
python-gflags (1.3-1) unstable; urgency=low
* Initial upload to unstable. (Closes: #588284)
Added: packages/python-gflags/trunk/debian/patches/python2.7-testsuite.patch
===================================================================
--- packages/python-gflags/trunk/debian/patches/python2.7-testsuite.patch (rev 0)
+++ packages/python-gflags/trunk/debian/patches/python2.7-testsuite.patch 2011-06-14 13:02:54 UTC (rev 17453)
@@ -0,0 +1,77 @@
+Description: Make test suite pass with Python2.7
+ Python 2.7's unittest module introduced some new methods
+ that gflags_unittest already had defined. This calls for
+ some special handling to avoid having them step on each
+ other's toes.
+Forwarded: http://code.google.com/p/python-gflags/issues/detail?id=7
+Author: Soren Hansen <soren at ubuntu.com>
+Last-Update: 2011-06-14
+Index: python-gflags-1.5.1/gflags_unittest.py
+===================================================================
+--- python-gflags-1.5.1.orig/gflags_unittest.py
++++ python-gflags-1.5.1/gflags_unittest.py
+@@ -102,22 +102,34 @@
+
+ return False
+
++class _UnitTestClass(unittest.TestCase):
++ def assertListEqual(self, list1, list2, msg=None):
++ """Asserts that, when sorted, list1 and list2 are identical."""
++ if hasattr(super(_UnitTestClass, self), 'assertListEqual'):
++ super(_UnitTestClass, self).assertListEqual(Sorted(list1), Sorted(list2))
++ else:
++ self.assertEqual(Sorted(list1), Sorted(list2))
++
++ def assertMultiLineEqual(self, expected, actual):
++ """Could do fancy diffing, but for now, just do a normal compare."""
++ self.assert_(MultiLineEqual(expected, actual))
+
+-class FlagsUnitTest(unittest.TestCase):
++ def assertRaisesWithRegexpMatch(self, exception, regexp, fn, *args, **kwargs):
++ try:
++ fn(*args, **kwargs)
++ except exception, why:
++ self.assert_(re.search(regexp, str(why)),
++ '"%s" does not match "%s"' % (regexp, why))
++ return
++ self.fail(exception.__name__ + ' not raised')
++
++class FlagsUnitTest(_UnitTestClass):
+ "Flags Unit Test"
+
+ def setUp(self):
+ # make sure we are using the old, stupid way of parsing flags.
+ FLAGS.UseGnuGetOpt(False)
+
+- def assertListEqual(self, list1, list2):
+- """Asserts that, when sorted, list1 and list2 are identical."""
+- self.assertEqual(Sorted(list1), Sorted(list2))
+-
+- def assertMultiLineEqual(self, expected, actual):
+- self.assert_(MultiLineEqual(expected, actual))
+-
+-
+ def test_flags(self):
+
+ ##############################################
+@@ -1411,19 +1423,11 @@
+ self.assertFalse('x5' in flag_values.RegisteredFlags())
+
+
+-class KeyFlagsTest(unittest.TestCase):
++class KeyFlagsTest(_UnitTestClass):
+
+ def setUp(self):
+ self.flag_values = flags.FlagValues()
+
+- def assertListEqual(self, list1, list2):
+- """Asserts that, when sorted, list1 and list2 are identical."""
+- self.assertEqual(Sorted(list1), Sorted(list2))
+-
+- def assertMultiLineEqual(self, s1, s2):
+- """Could do fancy diffing, but for now, just do a normal compare."""
+- self.assertEqual(s1, s2)
+-
+ def _GetNamesOfDefinedFlags(self, module, flag_values):
+ """Returns the list of names of flags defined by a module.
+
Modified: packages/python-gflags/trunk/debian/patches/series
===================================================================
--- packages/python-gflags/trunk/debian/patches/series 2011-06-14 11:57:35 UTC (rev 17452)
+++ packages/python-gflags/trunk/debian/patches/series 2011-06-14 13:02:54 UTC (rev 17453)
@@ -1 +1,2 @@
+python2.7-testsuite.patch
update-SOURCES.txt.patch
More information about the Python-modules-commits
mailing list