diff options
author | KP <kporangehat@gmail.com> | 2018-05-14 17:52:45 -0400 |
---|---|---|
committer | KP <kporangehat@gmail.com> | 2018-05-14 17:52:45 -0400 |
commit | 2bc3b2c12c6deb68164313386a036dc7543461fa (patch) | |
tree | 2dfaeae0d954e859f5fd32be5e42c0f8e926d4f0 /tests/test_testing.py | |
parent | 961a441af08dd24ff539e4640b6e6261a4006d22 (diff) | |
download | click-2bc3b2c12c6deb68164313386a036dc7543461fa.tar.gz |
Fix #616: allow setting prog_name in CliRunner.invoke
Diffstat (limited to 'tests/test_testing.py')
-rw-r--r-- | tests/test_testing.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_testing.py b/tests/test_testing.py index a74c5de..12f57de 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -246,3 +246,14 @@ def test_args(args, expected_output): result = runner.invoke(cli_args, args=args) assert result.exit_code == 0 assert result.output == expected_output + + +def test_setting_prog_name_in_extra(): + @click.command() + def cli(): + click.echo("ok") + + runner = CliRunner() + result = runner.invoke(cli, prog_name="foobar") + assert not result.exception + assert result.output == 'ok\n' |