Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/cssutils/, dev-python/cssutils/files/
Date: Thu, 26 Nov 2015 09:28:35
Message-Id: 1448530105.d924168b217c90faea5781e0c91fed0f5e797aab.jlec@gentoo
1 commit: d924168b217c90faea5781e0c91fed0f5e797aab
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 26 09:27:15 2015 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 26 09:28:25 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d924168b
7
8 dev-python/cssutils: Backport fix for test failures on pypy
9
10 Package-Manager: portage-2.2.25
11 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
12
13 dev-python/cssutils/cssutils-1.0.1.ebuild | 6 ++--
14 .../files/cssutils-1.0.1-pypy-test-backport.patch | 32 ++++++++++++++++++++++
15 2 files changed, 36 insertions(+), 2 deletions(-)
16
17 diff --git a/dev-python/cssutils/cssutils-1.0.1.ebuild b/dev-python/cssutils/cssutils-1.0.1.ebuild
18 index 60fc741..c2be49f 100644
19 --- a/dev-python/cssutils/cssutils-1.0.1.ebuild
20 +++ b/dev-python/cssutils/cssutils-1.0.1.ebuild
21 @@ -20,6 +20,10 @@ RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
22 DEPEND="${RDEPEND}
23 test? ( dev-python/mock[${PYTHON_USEDEP}] )"
24
25 +PATCHES=(
26 + "${FILESDIR}"/${P}-pypy-test-backport.patch
27 +)
28 +
29 python_prepare_all() {
30 # Disable test failing with dev-python/pyxml installed.
31 if has_version dev-python/pyxml; then
32 @@ -35,8 +39,6 @@ python_prepare_all() {
33 }
34
35 python_test() {
36 - # https://bitbucket.org/cthedot/cssutils/issues/55
37 - [[ "${EPYTHON}" =~ "pypy" ]] && return
38 ln -s "${S}/sheets" "${BUILD_DIR}/sheets" || die
39 # esetup.py test
40 # exclude tests that connect to the network
41
42 diff --git a/dev-python/cssutils/files/cssutils-1.0.1-pypy-test-backport.patch b/dev-python/cssutils/files/cssutils-1.0.1-pypy-test-backport.patch
43 new file mode 100644
44 index 0000000..89c7608
45 --- /dev/null
46 +++ b/dev-python/cssutils/files/cssutils-1.0.1-pypy-test-backport.patch
47 @@ -0,0 +1,32 @@
48 +# HG changeset patch
49 +# User Daniel <kingdread@×××.de>
50 +# Date 1448482419 -3600
51 +# Node ID 01a19d494b6f31e91c54ae39c5a6f43f6292a85d
52 +# Parent 3a01bd18118a6466ad93aa23caaa4164528b59ac
53 +Fix tests on PyPy 2
54 +
55 +Tests fail because of the extra "u" prefix in the error message
56 +
57 +diff --git a/src/cssutils/tests/test_profiles.py b/src/cssutils/tests/test_profiles.py
58 +--- a/src/cssutils/tests/test_profiles.py
59 ++++ b/src/cssutils/tests/test_profiles.py
60 +@@ -2,6 +2,7 @@
61 + __version__ = '$Id: test_cssvalue.py 1443 2008-08-31 13:54:39Z cthedot $'
62 +
63 + import sys
64 ++import platform
65 + import basetest
66 + import cssutils
67 +
68 +@@ -124,6 +125,11 @@
69 + expmsg = u"invalid literal for int(): x"
70 + elif sys.platform.startswith('java'):
71 + expmsg = u"invalid literal for int() with base 10: x"
72 ++ # PyPy adds the u prefix, but only in versions lower than Python 3
73 ++ elif (platform.python_implementation() == "PyPy" and
74 ++ sys.version_info < (3, 0)):
75 ++ expmsg = u"invalid literal for int() with base 10: u'x'"
76 ++
77 +
78 + self.assertRaisesMsg(Exception, expmsg,
79 + cssutils.profile.validate, u'-test-funcval', u'x')