diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-17 12:51:09 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-17 12:51:09 -0500 |
commit | 9b484ffa3f480889f6478d34d84987beddc08ba6 (patch) | |
tree | 94c89f650e3f2550aec42306adb9e685388f74a3 /coverage/summary.py | |
parent | 360c7725d4a82e5ad7b9ebc2e9aa459b39f5c2b4 (diff) | |
download | python-coveragepy-git-9b484ffa3f480889f6478d34d84987beddc08ba6.tar.gz |
Plain-text output no longer includes trailing spaces
Diffstat (limited to 'coverage/summary.py')
-rw-r--r-- | coverage/summary.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/coverage/summary.py b/coverage/summary.py index 5ddbb380..94c44584 100644 --- a/coverage/summary.py +++ b/coverage/summary.py @@ -30,8 +30,8 @@ class SummaryReporter(Reporter): # Prepare the formatting strings max_name = max([len(fr.relative_filename()) for fr in self.file_reporters] + [5]) fmt_name = u"%%- %ds " % max_name - fmt_err = u"%s %s: %s\n" - fmt_skip_covered = u"\n%s file%s skipped due to complete coverage.\n" + fmt_err = u"%s %s: %s" + fmt_skip_covered = u"\n%s file%s skipped due to complete coverage." header = (fmt_name % "Name") + u" Stmts Miss" fmt_coverage = fmt_name + u"%6d %6d" @@ -44,17 +44,16 @@ class SummaryReporter(Reporter): if self.config.show_missing: header += u" Missing" fmt_coverage += u" %s" - rule = u"-" * len(header) + u"\n" - header += u"\n" - fmt_coverage += u"\n" + rule = u"-" * len(header) if outfile is None: outfile = sys.stdout - if env.PY2: - writeout = lambda u: outfile.write(u.encode(output_encoding())) - else: - writeout = outfile.write + def writeout(line): + if env.PY2: + line = line.encode(output_encoding()) + outfile.write(line.rstrip()) + outfile.write("\n") # Write the header writeout(header) |