Skip to content
Myr

Added test for required

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 09d219d · Browse files · 1 file+11 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−0 removed

  • tests:+11 added−0 removed

1 file+11 added−0 removed

modified:tests/test_basic.py+11 added
204 unmodified lines
205 '(choose from foo, bar, baz)' in result.output206207 result = runner.invoke(cli, ['--help'])208 assert '--method [foo|bar|baz]' in result.output209210211def test_required_option(runner):212 @click.command()213 @click.option('--foo', required=True)214 def cli(foo):215 click.echo(foo)216217 result = runner.invoke(cli, [])218 assert result.exit_code == 2219 assert 'Missing option "--foo"' in result.output