summaryrefslogtreecommitdiff
path: root/coverage
diff options
context:
space:
mode:
Diffstat (limited to 'coverage')
-rw-r--r--coverage/results.py4
-rw-r--r--coverage/summary.py10
2 files changed, 10 insertions, 4 deletions
diff --git a/coverage/results.py b/coverage/results.py
index 676ba716..94785ca0 100644
--- a/coverage/results.py
+++ b/coverage/results.py
@@ -90,8 +90,10 @@ class Analysis(object):
"""
arcs = self.missing_branch_arcs()
+ line_exits = sorted(arcs.iteritems(), key=lambda (x, _): x)
pairs = []
- for line, exits in arcs.iteritems():
+ for line, exits in line_exits:
+ exits = sorted(exits)
for exit in exits:
pair = '%d->%d' % (line, exit)
pairs.append(pair)
diff --git a/coverage/summary.py b/coverage/summary.py
index 3588d31b..1e55a7d4 100644
--- a/coverage/summary.py
+++ b/coverage/summary.py
@@ -38,7 +38,7 @@ class SummaryReporter(Reporter):
header += " Missing"
fmt_coverage += " %s"
if self.branches:
- fmt_coverage += ", Branches: %s"
+ fmt_coverage += "%sBranches: %s"
rule = "-" * len(header) + "\n"
header += "\n"
fmt_coverage += "\n"
@@ -61,9 +61,13 @@ class SummaryReporter(Reporter):
args += (nums.n_branches, nums.n_missing_branches)
args += (nums.pc_covered_str,)
if self.config.show_missing:
- args += (analysis.missing_formatted(),)
+ missing_fmtd = analysis.missing_formatted()
+ args += (missing_fmtd,)
if self.branches:
- args += (analysis.arcs_missing_formatted(),)
+ separator = ""
+ if missing_fmtd:
+ separator = ", "
+ args += (separator, analysis.arcs_missing_formatted(),)
outfile.write(fmt_coverage % args)
total += nums
except KeyboardInterrupt: # pragma: not covered