Fix rewrite to not write past the edge of the screen
This commit is contained in:
parent
2455f8670e
commit
f05333ab75
|
@ -214,7 +214,7 @@ class TerminalReporter:
|
||||||
"""
|
"""
|
||||||
erase = markup.pop('erase', False)
|
erase = markup.pop('erase', False)
|
||||||
if erase:
|
if erase:
|
||||||
fill_count = self.writer.fullwidth - len(line)
|
fill_count = self.writer.fullwidth - len(line) - 1
|
||||||
fill = ' ' * fill_count
|
fill = ' ' * fill_count
|
||||||
else:
|
else:
|
||||||
fill = ''
|
fill = ''
|
||||||
|
|
|
@ -222,7 +222,7 @@ class TestTerminal(object):
|
||||||
tr.writer.fullwidth = 10
|
tr.writer.fullwidth = 10
|
||||||
tr.write('hello')
|
tr.write('hello')
|
||||||
tr.rewrite('hey', erase=True)
|
tr.rewrite('hey', erase=True)
|
||||||
assert f.getvalue() == 'hello' + '\r' + 'hey' + (7 * ' ')
|
assert f.getvalue() == 'hello' + '\r' + 'hey' + (6 * ' ')
|
||||||
|
|
||||||
|
|
||||||
class TestCollectonly(object):
|
class TestCollectonly(object):
|
||||||
|
|
Loading…
Reference in New Issue