diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2014-05-29 17:51:33 +0600 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2014-05-29 17:51:33 +0600 |
commit | 236e09cd7e2999d23dad63a1ad1d53ce3a648072 (patch) | |
tree | 5a75d45a510b785ae0c3f194d979f91c99028f4b /tests/test_compat.py | |
parent | 56e68e278b982f71bab5f6c756f0ffe10bf804b3 (diff) | |
download | click-236e09cd7e2999d23dad63a1ad1d53ce3a648072.tar.gz |
Do not warn about callback changes until 3.0
Diffstat (limited to 'tests/test_compat.py')
-rw-r--r-- | tests/test_compat.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/test_compat.py b/tests/test_compat.py index b2f9899..a46530c 100644 --- a/tests/test_compat.py +++ b/tests/test_compat.py @@ -1,16 +1,17 @@ import click -def test_legacy_callbacks(runner): - def legacy_callback(ctx, value): - return value.upper() +if click.__version__ >= '3.0': + def test_legacy_callbacks(runner): + def legacy_callback(ctx, value): + return value.upper() - @click.command() - @click.option('--foo', callback=legacy_callback) - def cli(foo): - click.echo(foo) + @click.command() + @click.option('--foo', callback=legacy_callback) + 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 + result = runner.invoke(cli, ['--foo', 'wat']) + assert result.exit_code == 0 + assert 'WAT' in result.output + assert 'Invoked legacy parameter callback' in result.output |