Skip to content
Myr

Added test for "--"

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 6334469 · Browse files · 1 file+24 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+24 added−0 removed

  • tests:+24 added−0 removed

1 file+24 added−0 removed

modified:tests/test_arguments.py+24 added
89 unmodified lines
9091 result = runner.invoke(cmd, [], env={'X': 'foo bar'})92 assert not result.exception93 assert result.output == 'foo|bar\n'949596def test_eat_options(runner):97 @click.command()98 @click.option('-f')99 @click.argument('files', nargs=-1)100 def cmd(f, files):101 for filename in files:102 click.echo(filename)103 click.echo(f)104105 result = runner.invoke(cmd, ['--', '-foo', 'bar'])106 assert result.output.splitlines() == [107 '-foo',108 'bar',109 '',110 ]111112 result = runner.invoke(cmd, ['-f', '-x', '--', '-foo', 'bar'])113 assert result.output.splitlines() == [114 '-foo',115 'bar',116 '-x',117 ]