summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVirgil Dupras <vdupras@gentoo.org>2019-05-08 10:40:02 -0400
committerVirgil Dupras <vdupras@gentoo.org>2019-05-08 10:41:17 -0400
commit25b1b4f492f813c6c92a8c10bdbe73662f3edb1b (patch)
tree8dd6e48c029009234698c23df07c8efd80342fe4
parentdev-python/testfixtures: bump to 6.8.2 (diff)
downloadgentoo-25b1b4f4.tar.gz
gentoo-25b1b4f4.tar.bz2
gentoo-25b1b4f4.zip
dev-python/xlutils: add py3 compat
Also, fix tests. Closes: https://bugs.gentoo.org/655826 Closes: https://bugs.gentoo.org/663412 Signed-off-by: Virgil Dupras <vdupras@gentoo.org> Package-Manager: Portage-2.3.62, Repoman-2.3.11
-rw-r--r--dev-python/xlutils/files/xlutils-2.0.0-fix-tests.patch23
-rw-r--r--dev-python/xlutils/xlutils-2.0.0-r1.ebuild (renamed from dev-python/xlutils/xlutils-2.0.0.ebuild)23
2 files changed, 38 insertions, 8 deletions
diff --git a/dev-python/xlutils/files/xlutils-2.0.0-fix-tests.patch b/dev-python/xlutils/files/xlutils-2.0.0-fix-tests.patch
new file mode 100644
index 000000000000..b7e74925095e
--- /dev/null
+++ b/dev-python/xlutils/files/xlutils-2.0.0-fix-tests.patch
@@ -0,0 +1,23 @@
+From e9edf279ba2e699be92da7611368cf92b4d87cec Mon Sep 17 00:00:00 2001
+From: Chris Withers <chris@simplistix.co.uk>
+Date: Wed, 4 Apr 2018 08:05:06 +0100
+Subject: [PATCH] fix test expectations
+
+---
+ xlutils/tests/test_view.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/xlutils/tests/test_view.py b/xlutils/tests/test_view.py
+index 7b32892..5b4aa2b 100644
+--- a/xlutils/tests/test_view.py
++++ b/xlutils/tests/test_view.py
+@@ -219,6 +219,8 @@ def test_does_not_match(self):
+ ('XX',)
+
+ actual:
+-(u'',)'''
++(u'',)
++
++While comparing [5][1]: 'XX' (expected) != u'' (actual)'''
+
+ compare(expected, actual=str(s.raised))
diff --git a/dev-python/xlutils/xlutils-2.0.0.ebuild b/dev-python/xlutils/xlutils-2.0.0-r1.ebuild
index d701317d1024..1da8b0f0d4bc 100644
--- a/dev-python/xlutils/xlutils-2.0.0.ebuild
+++ b/dev-python/xlutils/xlutils-2.0.0-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=7
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python2_7 python3_{5,6} )
inherit distutils-r1
@@ -18,18 +18,25 @@ LICENSE="MIT"
SLOT="0"
RDEPEND="
- dev-python/xlwt[${PYTHON_USEDEP}]
- dev-python/xlrd[${PYTHON_USEDEP}]"
+ >=dev-python/xlwt-1.3[${PYTHON_USEDEP}]
+ >=dev-python/xlrd-1.2[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
test? (
- dev-python/errorhandler[${PYTHON_USEDEP}]
- dev-python/manuel[${PYTHON_USEDEP}]
+ >=dev-python/errorhandler-2[${PYTHON_USEDEP}]
+ >=dev-python/manuel-1.9[${PYTHON_USEDEP}]
dev-python/mock[${PYTHON_USEDEP}]
+ dev-python/nose[${PYTHON_USEDEP}]
dev-python/pytest[${PYTHON_USEDEP}]
dev-python/testfixtures[${PYTHON_USEDEP}]
)"
+PATCHES=(
+ "${FILESDIR}/${PN}-2.0.0-fix-tests.patch"
+)
+
python_test() {
- py.test -v xlutils/tests || die "Tests fail with ${EPYTHON}"
+ # upstream runs its tests with nose, but the suite actually runs better
+ # when ran through pytest...
+ pytest -vv || die "Tests fail with ${EPYTHON}"
}