diff options
author | 2021-06-10 09:24:55 +0200 | |
---|---|---|
committer | 2021-06-10 09:25:22 +0200 | |
commit | c3374256e98b5bd0faf34c7657415de6ceaae805 (patch) | |
tree | 1993d794daa50953e7f2c2f6e569b93e256d8250 /dev-python/future | |
parent | app-misc/pax-utils: bump up to 1.3.2 (diff) | |
download | gentoo-c3374256e98b5bd0faf34c7657415de6ceaae805.tar.gz gentoo-c3374256e98b5bd0faf34c7657415de6ceaae805.tar.bz2 gentoo-c3374256e98b5bd0faf34c7657415de6ceaae805.zip |
dev-python/future: Fix tests
Closes: https://bugs.gentoo.org/795102
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/future')
-rw-r--r-- | dev-python/future/files/future-0.18.2-py39-fileurl.patch | 22 | ||||
-rw-r--r-- | 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 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() { |