From c3374256e98b5bd0faf34c7657415de6ceaae805 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 10 Jun 2021 09:24:55 +0200 Subject: dev-python/future: Fix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://bugs.gentoo.org/795102 Signed-off-by: Michał Górny --- .../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(-) create mode 100644 dev-python/future/files/future-0.18.2-py39-fileurl.patch (limited to 'dev-python/future') 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 000000000000..71ed088edcb5 --- /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 a959673b21e1..309c4a93ff2d 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() { -- cgit v1.2.3-65-gdbad