commit:     c3374256e98b5bd0faf34c7657415de6ceaae805
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 10 07:24:55 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 10 07:25:22 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3374256

dev-python/future: Fix tests

Closes: https://bugs.gentoo.org/795102
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../future/files/future-0.18.2-py39-fileurl.patch  | 22 ++++++++++++++++++++++
 dev-python/future/future-0.18.2-r1.ebuild          | 11 ++++++++---
 2 files changed, 30 insertions(+), 3 deletions(-)

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
new file mode 100644
index 00000000000..71ed088edcb
--- /dev/null
+++ b/dev-python/future/files/future-0.18.2-py39-fileurl.patch
@@ -0,0 +1,22 @@
+diff --git a/tests/test_future/test_urllib_toplevel.py 
b/tests/test_future/test_urllib_toplevel.py
+index 68bc4c9..923b2e8 100644
+--- a/tests/test_future/test_urllib_toplevel.py
++++ b/tests/test_future/test_urllib_toplevel.py
+@@ -120,7 +120,7 @@ class urlopen_FileTests(unittest.TestCase):
+         finally:
+             f.close()
+         self.pathname = support.TESTFN
+-        self.returned_obj = urlopen("file:%s" % self.pathname)
++        self.returned_obj = urlopen("file:%s" % 
urllib_parse.quote(self.pathname))
+ 
+     def tearDown(self):
+         """Shut down the open object"""
+@@ -167,7 +167,7 @@ class urlopen_FileTests(unittest.TestCase):
+         self.assertIsInstance(self.returned_obj.info(), email_message.Message)
+ 
+     def test_geturl(self):
+-        self.assertEqual(self.returned_obj.geturl(), self.pathname)
++        self.assertEqual(self.returned_obj.geturl(), 
urllib_parse.quote(self.pathname))
+ 
+     def test_getcode(self):
+         self.assertIsNone(self.returned_obj.getcode())

diff --git a/dev-python/future/future-0.18.2-r1.ebuild 
b/dev-python/future/future-0.18.2-r1.ebuild
index a959673b21e..309c4a93ff2 100644
--- a/dev-python/future/future-0.18.2-r1.ebuild
+++ b/dev-python/future/future-0.18.2-r1.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-PYTHON_COMPAT=( python3_{7,8,9} pypy3 )
+PYTHON_COMPAT=( python3_{8..9} pypy3 )
 DISTUTILS_USE_SETUPTOOLS=rdepend
 
 inherit distutils-r1
@@ -16,8 +16,12 @@ SLOT="0"
 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 
~amd64-linux ~x86-linux"
 IUSE="doc"
 
-# TODO: restore numpy when python2.7 is gone
-#BDEPEND="test? ( dev-python/numpy[${PYTHON_USEDEP}] )"
+BDEPEND="
+       test? (
+               $(python_gen_cond_dep '
+                       dev-python/numpy[${PYTHON_USEDEP}]
+               ' 'python*')
+       )"
 
 distutils_enable_tests pytest
 distutils_enable_sphinx docs dev-python/sphinx-bootstrap-theme
@@ -25,6 +29,7 @@ distutils_enable_sphinx docs dev-python/sphinx-bootstrap-theme
 PATCHES=(
        "${FILESDIR}"/${P}-tests.patch
        "${FILESDIR}"/${P}-py39.patch
+       "${FILESDIR}"/${P}-py39-fileurl.patch
 )
 
 python_prepare_all() {

Reply via email to