diff options
author | 2014-02-03 15:21:23 +0000 | |
---|---|---|
committer | 2014-02-03 15:21:23 +0000 | |
commit | 404fb5e1e281ebb41cee2248b7845f0caa23a72e (patch) | |
tree | 41aaeeaa71dcd1e8e7bf91d4623b71248dda4532 /dev-python/python-gflags | |
parent | Move patch comments out of the ebuild and into the patches where they belong. (diff) | |
download | gentoo-2-404fb5e1e281ebb41cee2248b7845f0caa23a72e.tar.gz gentoo-2-404fb5e1e281ebb41cee2248b7845f0caa23a72e.tar.bz2 gentoo-2-404fb5e1e281ebb41cee2248b7845f0caa23a72e.zip |
Add fix from upstream for running tests w/python-2.7 #447482 by Michał Górny.
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
Diffstat (limited to 'dev-python/python-gflags')
-rw-r--r-- | dev-python/python-gflags/ChangeLog | 6 | ||||
-rw-r--r-- | dev-python/python-gflags/files/python-gflags-2.0-tests-python-2.7.patch | 68 | ||||
-rw-r--r-- | dev-python/python-gflags/python-gflags-2.0.ebuild | 3 |
3 files changed, 75 insertions, 2 deletions
diff --git a/dev-python/python-gflags/ChangeLog b/dev-python/python-gflags/ChangeLog index e3f3621522e6..4c58fa841d9b 100644 --- a/dev-python/python-gflags/ChangeLog +++ b/dev-python/python-gflags/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-python/python-gflags # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/python-gflags/ChangeLog,v 1.15 2014/02/03 15:19:57 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/python-gflags/ChangeLog,v 1.16 2014/02/03 15:21:23 vapier Exp $ + + 03 Feb 2014; Mike Frysinger <vapier@gentoo.org> + +files/python-gflags-2.0-tests-python-2.7.patch, python-gflags-2.0.ebuild: + Add fix from upstream for running tests w/python-2.7 #447482 by Michał Górny. 03 Feb 2014; Mike Frysinger <vapier@gentoo.org> python-gflags-2.0.ebuild, files/python-gflags-2.0-scripts-install.patch, diff --git a/dev-python/python-gflags/files/python-gflags-2.0-tests-python-2.7.patch b/dev-python/python-gflags/files/python-gflags-2.0-tests-python-2.7.patch new file mode 100644 index 000000000000..2210b2b6eddd --- /dev/null +++ b/dev-python/python-gflags/files/python-gflags-2.0-tests-python-2.7.patch @@ -0,0 +1,68 @@ +https://bugs.gentoo.org/447482 + +------------------------------------------------------------------------ +r41 | jwilliams@endpoint.com | 2012-02-21 17:17:32 -0500 (Tue, 21 Feb 2012) | 5 lines + +Unit test updates for Python 2.7 compatibility + +* Add "msg" parameter to our versions of the test functions +* Change regex to match the updated 2.7 float() ValueError response + + +Index: tests/gflags_googletest.py +=================================================================== +--- tests/gflags_googletest.py (revision 40) ++++ tests/gflags_googletest.py (revision 41) +@@ -88,22 +88,22 @@ def MultiLineEqual(expected, actual): + + + class TestCase(unittest.TestCase): +- def assertListEqual(self, list1, list2): ++ def assertListEqual(self, list1, list2, msg=None): + """Asserts that, when sorted, list1 and list2 are identical.""" + # This exists in python 2.7, but not previous versions. Use the + # built-in version if possible. + if hasattr(unittest.TestCase, "assertListEqual"): +- unittest.TestCase.assertListEqual(self, Sorted(list1), Sorted(list2)) ++ unittest.TestCase.assertListEqual(self, Sorted(list1), Sorted(list2), msg) + else: +- self.assertEqual(Sorted(list1), Sorted(list2)) ++ self.assertEqual(Sorted(list1), Sorted(list2), msg) + +- def assertMultiLineEqual(self, expected, actual): ++ def assertMultiLineEqual(self, expected, actual, msg=None): + # This exists in python 2.7, but not previous versions. Use the + # built-in version if possible. + if hasattr(unittest.TestCase, "assertMultiLineEqual"): +- unittest.TestCase.assertMultiLineEqual(self, expected, actual) ++ unittest.TestCase.assertMultiLineEqual(self, expected, actual, msg) + else: +- self.assertTrue(MultiLineEqual(expected, actual)) ++ self.assertTrue(MultiLineEqual(expected, actual), msg) + + def assertRaisesWithRegexpMatch(self, exception, regexp, fn, *args, **kwargs): + try: +Index: tests/gflags_unittest.py +=================================================================== +--- tests/gflags_unittest.py (revision 40) ++++ tests/gflags_unittest.py (revision 41) +@@ -814,7 +814,7 @@ class MultiNumericalFlagsTest(googletest + + self.assertRaisesWithRegexpMatch( + gflags.IllegalFlagValue, +- 'flag --m_float2=abc: invalid literal for float\(\): abc', ++ 'flag --m_float2=abc: (invalid literal for float\(\)||could not convert string to float): abc', + gflags.DEFINE_multi_float, 'm_float2', ['abc'], 'desc') + + # Test non-parseable command line values. +@@ -831,7 +831,7 @@ class MultiNumericalFlagsTest(googletest + argv = ('./program', '--m_float2=def') + self.assertRaisesWithRegexpMatch( + gflags.IllegalFlagValue, +- 'flag --m_float2=def: invalid literal for float\(\): def', ++ 'flag --m_float2=def: (invalid literal for float\(\)||could not convert string to float): def', + FLAGS, argv) + + + +------------------------------------------------------------------------ diff --git a/dev-python/python-gflags/python-gflags-2.0.ebuild b/dev-python/python-gflags/python-gflags-2.0.ebuild index 0e4291c8b4d5..ab5e6123c177 100644 --- a/dev-python/python-gflags/python-gflags-2.0.ebuild +++ b/dev-python/python-gflags/python-gflags-2.0.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/python-gflags/python-gflags-2.0.ebuild,v 1.9 2014/02/03 15:19:57 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/python-gflags/python-gflags-2.0.ebuild,v 1.10 2014/02/03 15:21:23 vapier Exp $ EAPI="5" @@ -24,6 +24,7 @@ PATCHES=( "${FILESDIR}"/${P}-scripts-install.patch "${FILESDIR}"/${P}-tests-respect-tmpdir.patch "${FILESDIR}"/${P}-skip-test-as-root.patch #475134 + "${FILESDIR}"/${P}-tests-python-2.7.patch #447482 ) python_test() { |