summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVirgil Dupras <vdupras@gentoo.org>2018-08-13 07:59:14 -0400
committerVirgil Dupras <vdupras@gentoo.org>2018-08-13 08:01:23 -0400
commitb267275c6ee8b262b695f4a07a555b815869767a (patch)
tree107e76573b64b9cdc06f98f4aa8012f8ed7504b8
parentsci-libs/keras-preprocessing: new package (diff)
downloadgentoo-b267275c6ee8b262b695f4a07a555b815869767a.tar.gz
gentoo-b267275c6ee8b262b695f4a07a555b815869767a.tar.bz2
gentoo-b267275c6ee8b262b695f4a07a555b815869767a.zip
dev-python/click: fix broken tests
Closes: https://bugs.gentoo.org/635806 Package-Manager: Portage-2.3.46, Repoman-2.3.10
-rw-r--r--dev-python/click/click-6.7.ebuild5
-rw-r--r--dev-python/click/files/click-6.7-fix-tests.patch65
2 files changed, 70 insertions, 0 deletions
diff --git a/dev-python/click/click-6.7.ebuild b/dev-python/click/click-6.7.ebuild
index a594f6dc8176..74c2f3587ec8 100644
--- a/dev-python/click/click-6.7.ebuild
+++ b/dev-python/click/click-6.7.ebuild
@@ -23,6 +23,11 @@ DEPEND="
test? ( dev-python/pytest[${PYTHON_USEDEP}] )
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
+PATCHES=(
+ # From upstream, can be removed in next release.
+ "${FILESDIR}/${PN}-6.7-fix-tests.patch"
+)
+
pkg_setup() {
use doc && DISTUTILS_ALL_SUBPHASE_IMPLS=( 'python2*' )
}
diff --git a/dev-python/click/files/click-6.7-fix-tests.patch b/dev-python/click/files/click-6.7-fix-tests.patch
new file mode 100644
index 000000000000..8a305e3665dd
--- /dev/null
+++ b/dev-python/click/files/click-6.7-fix-tests.patch
@@ -0,0 +1,65 @@
+From 20b4b1c0d1564ab4ef44b7d27d5b650735e28be3 Mon Sep 17 00:00:00 2001
+From: Armin Ronacher <armin.ronacher@active-4.com>
+Date: Sat, 23 Dec 2017 09:27:57 +0100
+Subject: [PATCH] Updated tests to work with newer pytest versions
+
+---
+ tests/test_basic.py | 2 +-
+ tests/test_compat.py | 9 +++++----
+ tests/test_options.py | 2 +-
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/tests/test_basic.py b/tests/test_basic.py
+index 045f608..960cd32 100644
+--- a/tests/test_basic.py
++++ b/tests/test_basic.py
+@@ -357,7 +357,7 @@ def test_required_option(runner):
+ def test_evaluation_order(runner):
+ called = []
+
+- def memo(ctx, value):
++ def memo(ctx, param, value):
+ called.append(value)
+ return value
+
+diff --git a/tests/test_compat.py b/tests/test_compat.py
+index e4ecdc8..9dacc21 100644
+--- a/tests/test_compat.py
++++ b/tests/test_compat.py
+@@ -1,4 +1,5 @@
+ import click
++import pytest
+
+
+ if click.__version__ >= '3.0':
+@@ -11,10 +12,10 @@ if click.__version__ >= '3.0':
+ def cli(foo):
+ click.echo(foo)
+
+- result = runner.invoke(cli, ['--foo', 'wat'])
+- assert result.exit_code == 0
+- assert 'WAT' in result.output
+- assert 'Invoked legacy parameter callback' in result.output
++ with pytest.warns(Warning, match='Invoked legacy parameter callback'):
++ result = runner.invoke(cli, ['--foo', 'wat'])
++ assert result.exit_code == 0
++ assert 'WAT' in result.output
+
+
+ def test_bash_func_name():
+diff --git a/tests/test_options.py b/tests/test_options.py
+index 9dd8cdf..8bdda1f 100644
+--- a/tests/test_options.py
++++ b/tests/test_options.py
+@@ -199,7 +199,7 @@ def test_nargs_envvar(runner):
+
+
+ def test_custom_validation(runner):
+- def validate_pos_int(ctx, value):
++ def validate_pos_int(ctx, param, value):
+ if value < 0:
+ raise click.BadParameter('Value needs to be positive')
+ return value
+--
+2.16.4
+