summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWANG Xuerui <xen0n@gentoo.org>2022-05-05 10:35:55 +0800
committerWANG Xuerui <xen0n@gentoo.org>2022-05-05 10:38:53 +0800
commit47763eae812c5684530f4ca6f233292bdc97f475 (patch)
tree3d44ffbc92ab6b376b75a60101bb5349ce4e8e32 /dev-python/pycurl
parentvirtual/mta: keyword 1-r2 for ~loong (diff)
downloadgentoo-47763eae812c5684530f4ca6f233292bdc97f475.tar.gz
gentoo-47763eae812c5684530f4ca6f233292bdc97f475.tar.bz2
gentoo-47763eae812c5684530f4ca6f233292bdc97f475.zip
dev-python/pycurl: fix tests with >=net-misc/curl-7.83
Patch from upstream main branch applies cleanly. Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
Diffstat (limited to 'dev-python/pycurl')
-rw-r--r--dev-python/pycurl/files/7.44-fix-tests.patch34
-rw-r--r--dev-python/pycurl/pycurl-7.44.1.ebuild6
2 files changed, 39 insertions, 1 deletions
diff --git a/dev-python/pycurl/files/7.44-fix-tests.patch b/dev-python/pycurl/files/7.44-fix-tests.patch
new file mode 100644
index 000000000000..d5d900100086
--- /dev/null
+++ b/dev-python/pycurl/files/7.44-fix-tests.patch
@@ -0,0 +1,34 @@
+https://github.com/pycurl/pycurl/commit/d47c68b1364f8a1a45ab8c584c291d44b762f7b1
+From: Samuel Henrique <samueloph@debian.org>
+Date: Sat, 30 Apr 2022 23:02:34 +0100
+Subject: [PATCH] tests: fix error message on error_test (for curl >= 7.83)
+
+curl 7.83.0 removed exclamation marks from a few error messages, curl commit:
+https://github.com/curl/curl/commit/6968fb9d54dc3a1aaa1b16088f038eaf5dd8b2d7
+
+This commit adds support for the new curl release while also supporting the previous ones.
+--- a/tests/error_test.py
++++ b/tests/error_test.py
+@@ -29,7 +29,8 @@ def test_pycurl_error_libcurl(self):
+ err, msg = exc.args
+ self.assertEqual(pycurl.E_URL_MALFORMAT, err)
+ # possibly fragile
+- self.assertEqual('No URL set!', msg)
++ # curl < 7.83.0 has an exclamation mark in this error message
++ self.assertIn(msg, ['No URL set!', 'No URL set'])
+ else:
+ self.fail('Expected pycurl.error to be raised')
+
+@@ -43,9 +44,10 @@ def test_pycurl_errstr_type(self):
+ self.curl.perform()
+ except pycurl.error:
+ # might be fragile
+- self.assertEqual('No URL set!', self.curl.errstr())
++ # curl < 7.83.0 has an exclamation mark in this error message
++ self.assertIn(self.curl.errstr(), ['No URL set!', 'No URL set'])
+ # repeated checks do not clear value
+- self.assertEqual('No URL set!', self.curl.errstr())
++ self.assertIn(self.curl.errstr(), ['No URL set!', 'No URL set'])
+ # check the type - on all python versions
+ self.assertEqual(str, type(self.curl.errstr()))
+ else:
diff --git a/dev-python/pycurl/pycurl-7.44.1.ebuild b/dev-python/pycurl/pycurl-7.44.1.ebuild
index 92d80f17d663..f7a3e1085fc4 100644
--- a/dev-python/pycurl/pycurl-7.44.1.ebuild
+++ b/dev-python/pycurl/pycurl-7.44.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -44,6 +44,10 @@ DEPEND="${RDEPEND}
>=dev-python/bottle-0.12.7[${PYTHON_USEDEP}]
)"
+PATCHES=(
+ "${FILESDIR}/7.44-fix-tests.patch"
+)
+
python_prepare_all() {
# docs installed into the wrong directory
sed -e "/setup_args\['data_files'\] = /d" -i setup.py || die