Skip to content
Myr

Updated tests to work with newer pytest versions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 9bd66b3 · Browse files · 3 files+7 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+7 added−6 removed

  • tests:+7 added−6 removed

3 files+7 added−6 removed

modified:tests/test_basic.py+1 added-1 removed
355 unmodified lines
356357def test_evaluation_order(runner):358 called = []359360 def memo(ctx, value):360 def memo(ctx, param, value):361 called.append(value)362 return value363364 @click.command()
35 unmodified lines
modified:tests/test_compat.py+5 added-4 removed
1import click2import pytest345if click.__version__ >= '3.0':6 def test_legacy_callbacks(runner):
4 unmodified lines
11 @click.option('--foo', callback=legacy_callback)12 def cli(foo):13 click.echo(foo)1414 result = runner.invoke(cli, ['--foo', 'wat'])15 assert result.exit_code == 016 assert 'WAT' in result.output17 assert 'Invoked legacy parameter callback' in result.output15 with pytest.warns(Warning, match='Invoked legacy parameter callback'):16 result = runner.invoke(cli, ['--foo', 'wat'])17 assert result.exit_code == 018 assert 'WAT' in result.output192021def test_bash_func_name():22 from click._bashcomplete import get_completion_script
3 unmodified lines
modified:tests/test_options.py+1 added-1 removed
197 unmodified lines
198 assert result.output == 'x|1\ny|2\n'199200201def test_custom_validation(runner):202 def validate_pos_int(ctx, value):202 def validate_pos_int(ctx, param, value):203 if value < 0:204 raise click.BadParameter('Value needs to be positive')205 return value206
153 unmodified lines