summaryrefslogtreecommitdiff
path: root/tests/test_testing.py
diff options
context:
space:
mode:
authorKP <kporangehat@gmail.com>2018-05-14 17:52:45 -0400
committerKP <kporangehat@gmail.com>2018-05-14 17:52:45 -0400
commit2bc3b2c12c6deb68164313386a036dc7543461fa (patch)
tree2dfaeae0d954e859f5fd32be5e42c0f8e926d4f0 /tests/test_testing.py
parent961a441af08dd24ff539e4640b6e6261a4006d22 (diff)
downloadclick-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.py11
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'