Blob Blame Raw
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 045f6085..960cd327 100644
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -357,7 +357,7 @@ def cli(foo):
 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 e4ecdc81..9dacc21d 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 @@ def legacy_callback(ctx, value):
         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 9dd8cdff..8bdda1f1 100644
--- a/tests/test_options.py
+++ b/tests/test_options.py
@@ -199,7 +199,7 @@ def cmd(arg):
 
 
 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