Skip to content
Myr

Merge branch '6.x-maintenance'

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 · parents 92532b5, 20b4b1c · 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
410 unmodified lines
411412def test_evaluation_order(runner):413 called = []414415 def memo(ctx, value):415 def memo(ctx, param, value):416 called.append(value)417 return value418419 @click.command()
79 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
157 unmodified lines