diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-04-21 13:56:18 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-04-21 13:57:10 +0200 |
commit | 07a32969d5e4a1e81f5e6cee1ec2d0d0e44fedd8 (patch) | |
tree | b12fe9124c315c02425c166c261fac5c9b556a19 /dev-python/mechanize | |
parent | dev-tex/rubber: Install GNU Info file in correct location (diff) | |
download | gentoo-07a32969d5e4a1e81f5e6cee1ec2d0d0e44fedd8.tar.gz gentoo-07a32969d5e4a1e81f5e6cee1ec2d0d0e44fedd8.tar.bz2 gentoo-07a32969d5e4a1e81f5e6cee1ec2d0d0e44fedd8.zip |
dev-python/mechanize: Backport a test fix
Closes: https://bugs.gentoo.org/930257
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/mechanize')
-rw-r--r-- | dev-python/mechanize/files/mechanize-0.4.9-test.patch | 23 | ||||
-rw-r--r-- | dev-python/mechanize/mechanize-0.4.9.ebuild | 9 |
2 files changed, 30 insertions, 2 deletions
diff --git a/dev-python/mechanize/files/mechanize-0.4.9-test.patch b/dev-python/mechanize/files/mechanize-0.4.9-test.patch new file mode 100644 index 000000000000..369cbe9495e1 --- /dev/null +++ b/dev-python/mechanize/files/mechanize-0.4.9-test.patch @@ -0,0 +1,23 @@ +From 1324b09b661aaac7d4cdc7e1e9d49e1c3851db2c Mon Sep 17 00:00:00 2001 +From: Martin Weinelt <hexa@darmstadt.ccc.de> +Date: Sun, 21 Apr 2024 13:05:45 +0200 +Subject: [PATCH] Fix test_ftp mime type expectation on 3.11+ + +Closes: #94 +--- + test/test_urllib2.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/test_urllib2.py b/test/test_urllib2.py +index e9b96fd..c46a2fc 100644 +--- a/test/test_urllib2.py ++++ b/test/test_urllib2.py +@@ -864,7 +864,7 @@ def connect_ftp(self, user, passwd, host, port, dirs, timeout): + ["foo", "bar"], _sockettimeout._GLOBAL_DEFAULT_TIMEOUT, "", None), + ("ftp://localhost/baz.gif;type=a", "localhost", ftplib.FTP_PORT, + "A", [], _sockettimeout._GLOBAL_DEFAULT_TIMEOUT, "baz.gif", +- None), # TODO: really this should guess image/gif ++ "image/gif" if sys.version_info >= (3, 11) else None), + ]: + req = Request(url, timeout=timeout) + r = h.ftp_open(req) diff --git a/dev-python/mechanize/mechanize-0.4.9.ebuild b/dev-python/mechanize/mechanize-0.4.9.ebuild index 9f450d7fd6b3..801db8146541 100644 --- a/dev-python/mechanize/mechanize-0.4.9.ebuild +++ b/dev-python/mechanize/mechanize-0.4.9.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -29,6 +29,11 @@ BDEPEND=" ) " +PATCHES=( + # https://github.com/python-mechanize/mechanize/pull/95 + "${FILESDIR}/${P}-test.patch" +) + python_test() { - "${EPYTHON}" run_tests.py || die + "${EPYTHON}" run_tests.py -v || die } |