summaryrefslogtreecommitdiff
path: root/coverage/misc.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/misc.py')
-rw-r--r--coverage/misc.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/coverage/misc.py b/coverage/misc.py
index c484d61e..c16b6b4a 100644
--- a/coverage/misc.py
+++ b/coverage/misc.py
@@ -107,44 +107,6 @@ def nice_pair(pair):
return "%d-%d" % (start, end)
-def format_lines(statements, lines):
- """Nicely format a list of line numbers.
-
- Format a list of line numbers for printing by coalescing groups of lines as
- long as the lines represent consecutive statements. This will coalesce
- even if there are gaps between statements.
-
- For example, if `statements` is [1,2,3,4,5,10,11,12,13,14] and
- `lines` is [1,2,5,10,11,13,14] then the result will be "1-2, 5-11, 13-14".
-
- Both `lines` and `statements` can be any iterable. All of the elements of
- `lines` must be in `statements`, and all of the values must be positive
- integers.
-
- """
- statements = sorted(statements)
- lines = sorted(lines)
-
- pairs = []
- start = None
- lidx = 0
- for stmt in statements:
- if lidx >= len(lines):
- break
- if stmt == lines[lidx]:
- lidx += 1
- if not start:
- start = stmt
- end = stmt
- elif start:
- pairs.append((start, end))
- start = None
- if start:
- pairs.append((start, end))
- ret = ', '.join(map(nice_pair, pairs))
- return ret
-
-
def expensive(fn):
"""A decorator to indicate that a method shouldn't be called more than once.