Skip to content
Myr

test_compat.py

This file

Path

tests/test_compat.py

17 lines · 490 bytes · Python

Last changed by

Do not warn about callback changes until 3.0Armin Ronacherbefore adoption236e09c

History of this file

Take it

1import click234if click.__version__ >= '3.0':5    def test_legacy_callbacks(runner):6        def legacy_callback(ctx, value):7            return value.upper()89        @click.command()10        @click.option('--foo', callback=legacy_callback)11        def cli(foo):12            click.echo(foo)1314        result = runner.invoke(cli, ['--foo', 'wat'])15        assert result.exit_code == 016        assert 'WAT' in result.output17        assert 'Invoked legacy parameter callback' in result.output