summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-12-26 06:19:51 -0500
committerNed Batchelder <ned@nedbatchelder.com>2018-12-26 06:19:51 -0500
commitade98fc1e0d80ca05554312454173b607f893304 (patch)
tree4f08b61763c9eb4e67cd296c5c17cf4c0bc5e60c
parent31a42af7739f55033f122b28eb4beb0bb4ffdafd (diff)
downloadpython-coveragepy-git-ade98fc1e0d80ca05554312454173b607f893304.tar.gz
Simplify format_lines a little
-rw-r--r--coverage/results.py4
-rw-r--r--tests/test_results.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/coverage/results.py b/coverage/results.py
index 529899de..7b7985ac 100644
--- a/coverage/results.py
+++ b/coverage/results.py
@@ -303,14 +303,14 @@ def format_lines(statements, lines, arcs=None):
included in the output as long as start isn't in `lines`.
"""
- line_items = [(pair[0], 0, nice_pair(pair)) for pair in _line_ranges(statements, lines)]
+ line_items = [(pair[0], nice_pair(pair)) for pair in _line_ranges(statements, lines)]
if arcs:
line_exits = sorted(arcs)
for line, exits in line_exits:
for ex in sorted(exits):
if line not in lines:
dest = (ex if ex > 0 else "exit")
- line_items.append((line, 1, "%d->%s" % (line, dest)))
+ line_items.append((line, "%d->%s" % (line, dest)))
ret = ', '.join(t[-1] for t in sorted(line_items))
return ret
diff --git a/tests/test_results.py b/tests/test_results.py
index 41494e66..86806cfd 100644
--- a/tests/test_results.py
+++ b/tests/test_results.py
@@ -136,7 +136,7 @@ def test_format_lines(statements, lines, result):
(
[1,2,3,4,5,10,11,12,13,14,98,99],
[1,2,5,10,11,13,14,99],
- [(3, [4]), (98, [100, -1])],
+ [(3, [4]), (5, [10, 11]), (98, [100, -1])],
"1-2, 3->4, 5-11, 13-14, 98->100, 98->exit, 99"
),
(