Add a flag --no-ansi to remove control characters on parallel executions

Signed-off-by: Cecile Tonglet <cecile.tonglet@gmail.com>
This commit is contained in:
Cecile Tonglet 2017-06-23 15:17:38 +02:00 committed by Joffrey F
parent f9aaa72c54
commit b0b671dbf2
6 changed files with 78 additions and 33 deletions

View file

@ -130,3 +130,19 @@ def test_parallel_execute_alignment(capsys):
_, err = capsys.readouterr()
a, b = err.split('\n')[:2]
assert a.index('...') == b.index('...')
def test_parallel_execute_alignment_noansi(capsys):
results, errors = parallel_execute(
objects=["short", "a very long name"],
func=lambda x: x,
get_name=six.text_type,
msg="Aligning",
noansi=True,
)
assert errors == {}
_, err = capsys.readouterr()
a, b, c, d = err.split('\n')[:4]
assert a.index('...') == b.index('...') == c.index('...') == d.index('...')