Skip to content
Myr

add format test for bad argument with metavar

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

authored by LokiHokie · committed by LokiHokie · parent f21f014 · Browse files · 1 file+17 added−1 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+17 added−1 removed

  • tests:+17 added−1 removed

1 file+17 added−1 removed

modified:tests/test_formatting.py+17 added-1 removed
161 unmodified lines
162 'Error: Missing argument "ARG".'163 ]164165166def test_formatting_usage_error_metavar(runner):166def test_formatting_usage_error_metavar_missing_arg(runner):167 """168 :author: @r-m-n169 Including attribution to #612170 """
11 unmodified lines
182 'Error: Missing argument "metavar".'183 ]184185186def test_formatting_usage_error_metavar_bad_arg(runner):187 @click.command()188 @click.argument('arg', type=click.INT, metavar='metavar')189 def cmd(arg):190 pass191192 result = runner.invoke(cmd, ['3.14'])193 assert result.exit_code == 2194 assert result.output.splitlines() == [195 'Usage: cmd [OPTIONS] metavar',196 'Try "cmd --help" for help.',197 '',198 'Error: Invalid value for "metavar": 3.14 is not a valid integer'199 ]200201202def test_formatting_usage_error_nested(runner):203 @click.group()204 def cmd():205 pass
45 unmodified lines