python-click/tests/test_termui.py

15 lines
394 B
Python
Raw Normal View History

2014-10-16 20:40:34 +02:00
import click
def test_progressbar_strip_regression(runner, monkeypatch):
label = ' padded line'
@click.command()
def cli():
with click.progressbar(tuple(range(10)), label=label) as progress:
for thing in progress:
pass
monkeypatch.setattr(click._termui_impl, 'isatty', lambda _: True)
assert label in runner.invoke(cli, []).output