Skip to content
Myr

Refine testcase

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

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parent 02ea9ee · Browse files · 1 file+10 added−7 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+10 added−7 removed

  • tests:+10 added−7 removed

1 file+10 added−7 removed

modified:tests/test_termui.py+10 added-7 removed
43 unmodified lines
44 assert result.exception is None454647def test_choices_list_in_prompt(runner, monkeypatch):48 @click.option('-g', type=click.Choice(['none', 'day', 'week', 'month']), prompt=True)48 @click.command()49 @click.option('-g', type=click.Choice(['none', 'day', 'week', 'month']),50 prompt=True)50 def cli_with_choices():51 def cli_with_choices(g):52 pass5353 @click.option('-g', type=click.Choice(['none', 'day', 'week', 'month']), prompt=True, show_choices=False)54 @click.command()55 @click.option('-g', type=click.Choice(['none', 'day', 'week', 'month']),56 prompt=True, show_choices=False)55 def cli_without_choices():57 def cli_without_choices(g):58 pass5958 monkeypatch.setattr(click._termui_impl, 'isatty', lambda _: True)60 result = runner.invoke(cli_with_choices, [], input='none')61 assert '(none, day, week, month)' in result.output6260 assert '(none, day, week, month)' in runner.invoke(cli_with_choices, [], input='none').output61 assert '(none, day, week, month)' not in runner.invoke(cli_without_choices, [], input='none').output63 result = runner.invoke(cli_without_choices, [], input='none')64 assert '(none, day, week, month)' not in result.output656667def test_secho(runner):68 with runner.isolation() as out:
3 unmodified lines