Ensure final collected line doesn't include artifacts

We sometimes would see the following line:
collected 1 item s

just because previous write to the terminal includes number of
characters greater than 'collected 1 item'.
This commit is contained in:
Alex Hartoto 2017-07-13 12:01:21 -07:00
parent 771cedd3da
commit 97fdc9a7fe
2 changed files with 4 additions and 0 deletions

View File

@ -290,6 +290,9 @@ class TerminalReporter:
if self.isatty: if self.isatty:
if final: if final:
line += " \n" line += " \n"
# Rewrite with empty line so we will not see the artifact of
# previous write
self.rewrite('')
self.rewrite(line, bold=True) self.rewrite(line, bold=True)
else: else:
self.write_line(line) self.write_line(line)

1
changelog/2571.trivial Normal file
View File

@ -0,0 +1 @@
Ensure final collected line doesn't include artifacts of previous write.