summaryrefslogtreecommitdiff
path: root/docs/testing.rst
diff options
context:
space:
mode:
authorSimon Willison <swillison@gmail.com>2018-08-04 17:40:49 -0700
committerGitHub <noreply@github.com>2018-08-04 17:40:49 -0700
commit997226ab325a954c8e89078ce0ab3bef9df21574 (patch)
tree4d0909adc5be116669c233b58edb2083196be195 /docs/testing.rst
parentdbc785f86aa5b73aa14aca911379addff77823e3 (diff)
downloadclick-997226ab325a954c8e89078ce0ab3bef9df21574.tar.gz
Document extra keyword arguments to .invoke()
e.g. passing a fixed terminal_width.
Diffstat (limited to 'docs/testing.rst')
-rw-r--r--docs/testing.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/testing.rst b/docs/testing.rst
index 3c046bf..174b775 100644
--- a/docs/testing.rst
+++ b/docs/testing.rst
@@ -61,6 +61,11 @@ Example::
assert 'Debug mode is on' in result.output
assert 'Syncing' in result.output
+Additional keyword arguments passed to ``.invoke()`` will be used to construct the initial Context object. For example, if you want to run your tests against a fixed terminal width you can use the following::
+
+ runner = CliRunner()
+ result = runner.invoke(cli, ['--debug', 'sync'], terminal_width=60)
+
File System Isolation
---------------------