1 |
commit: c3374256e98b5bd0faf34c7657415de6ceaae805 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 10 07:24:55 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 10 07:25:22 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3374256 |
7 |
|
8 |
dev-python/future: Fix tests |
9 |
|
10 |
Closes: https://bugs.gentoo.org/795102 |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
.../future/files/future-0.18.2-py39-fileurl.patch | 22 ++++++++++++++++++++++ |
14 |
dev-python/future/future-0.18.2-r1.ebuild | 11 ++++++++--- |
15 |
2 files changed, 30 insertions(+), 3 deletions(-) |
16 |
|
17 |
diff --git a/dev-python/future/files/future-0.18.2-py39-fileurl.patch b/dev-python/future/files/future-0.18.2-py39-fileurl.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..71ed088edcb |
20 |
--- /dev/null |
21 |
+++ b/dev-python/future/files/future-0.18.2-py39-fileurl.patch |
22 |
@@ -0,0 +1,22 @@ |
23 |
+diff --git a/tests/test_future/test_urllib_toplevel.py b/tests/test_future/test_urllib_toplevel.py |
24 |
+index 68bc4c9..923b2e8 100644 |
25 |
+--- a/tests/test_future/test_urllib_toplevel.py |
26 |
++++ b/tests/test_future/test_urllib_toplevel.py |
27 |
+@@ -120,7 +120,7 @@ class urlopen_FileTests(unittest.TestCase): |
28 |
+ finally: |
29 |
+ f.close() |
30 |
+ self.pathname = support.TESTFN |
31 |
+- self.returned_obj = urlopen("file:%s" % self.pathname) |
32 |
++ self.returned_obj = urlopen("file:%s" % urllib_parse.quote(self.pathname)) |
33 |
+ |
34 |
+ def tearDown(self): |
35 |
+ """Shut down the open object""" |
36 |
+@@ -167,7 +167,7 @@ class urlopen_FileTests(unittest.TestCase): |
37 |
+ self.assertIsInstance(self.returned_obj.info(), email_message.Message) |
38 |
+ |
39 |
+ def test_geturl(self): |
40 |
+- self.assertEqual(self.returned_obj.geturl(), self.pathname) |
41 |
++ self.assertEqual(self.returned_obj.geturl(), urllib_parse.quote(self.pathname)) |
42 |
+ |
43 |
+ def test_getcode(self): |
44 |
+ self.assertIsNone(self.returned_obj.getcode()) |
45 |
|
46 |
diff --git a/dev-python/future/future-0.18.2-r1.ebuild b/dev-python/future/future-0.18.2-r1.ebuild |
47 |
index a959673b21e..309c4a93ff2 100644 |
48 |
--- a/dev-python/future/future-0.18.2-r1.ebuild |
49 |
+++ b/dev-python/future/future-0.18.2-r1.ebuild |
50 |
@@ -2,7 +2,7 @@ |
51 |
# Distributed under the terms of the GNU General Public License v2 |
52 |
|
53 |
EAPI=7 |
54 |
-PYTHON_COMPAT=( python3_{7,8,9} pypy3 ) |
55 |
+PYTHON_COMPAT=( python3_{8..9} pypy3 ) |
56 |
DISTUTILS_USE_SETUPTOOLS=rdepend |
57 |
|
58 |
inherit distutils-r1 |
59 |
@@ -16,8 +16,12 @@ SLOT="0" |
60 |
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux" |
61 |
IUSE="doc" |
62 |
|
63 |
-# TODO: restore numpy when python2.7 is gone |
64 |
-#BDEPEND="test? ( dev-python/numpy[${PYTHON_USEDEP}] )" |
65 |
+BDEPEND=" |
66 |
+ test? ( |
67 |
+ $(python_gen_cond_dep ' |
68 |
+ dev-python/numpy[${PYTHON_USEDEP}] |
69 |
+ ' 'python*') |
70 |
+ )" |
71 |
|
72 |
distutils_enable_tests pytest |
73 |
distutils_enable_sphinx docs dev-python/sphinx-bootstrap-theme |
74 |
@@ -25,6 +29,7 @@ distutils_enable_sphinx docs dev-python/sphinx-bootstrap-theme |
75 |
PATCHES=( |
76 |
"${FILESDIR}"/${P}-tests.patch |
77 |
"${FILESDIR}"/${P}-py39.patch |
78 |
+ "${FILESDIR}"/${P}-py39-fileurl.patch |
79 |
) |
80 |
|
81 |
python_prepare_all() { |