diff options
Diffstat (limited to 'coverage/misc.py')
-rw-r--r-- | coverage/misc.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/coverage/misc.py b/coverage/misc.py new file mode 100644 index 0000000..15ddad0 --- /dev/null +++ b/coverage/misc.py @@ -0,0 +1,18 @@ +"""Miscellaneous stuff for coverage.py""" + +def nice_pair(pair): + """Make a nice string representation of a pair of numbers. + + If the numbers are equal, just return the number, otherwise return the pair + with a dash between them, indicating the range. + + """ + start, end = pair + if start == end: + return "%d" % start + else: + return "%d-%d" % (start, end) + + +class CoverageException(Exception): + pass |