Skip to content

Commit

Permalink
Ensure final collected line doesn't include artifacts
Browse files Browse the repository at this point in the history
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'.
  • Loading branch information
ahartoto committed Jul 13, 2017
1 parent 771cedd commit 97fdc9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _pytest/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ def report_collect(self, final=False):
if self.isatty:
if final:
line += " \n"
# Rewrite with empty line so we will not see the artifact of
# previous write
self.rewrite('')
self.rewrite(line, bold=True)
else:
self.write_line(line)
Expand Down
1 change: 1 addition & 0 deletions changelog/2571.trivial
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure final collected line doesn't include artifacts of previous write.

0 comments on commit 97fdc9a

Please sign in to comment.