diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-24 07:42:48 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-24 07:42:48 -0400 |
commit | 23707fc57d79b986311354c91df9c3ad40cf0080 (patch) | |
tree | c927722b57680598c813917de2b487723bfeaa1a /coverage/debug.py | |
parent | 4581664df6e25f77b1685359c5aa94c5760be64a (diff) | |
download | python-coveragepy-23707fc57d79b986311354c91df9c3ad40cf0080.tar.gz |
Data dumps can be canonicalized for comparison
Diffstat (limited to 'coverage/debug.py')
-rw-r--r-- | coverage/debug.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/coverage/debug.py b/coverage/debug.py index 8ae087d..8d6892b 100644 --- a/coverage/debug.py +++ b/coverage/debug.py @@ -4,9 +4,7 @@ """Control of and utilities for debugging.""" import inspect -import json import os -import re import sys @@ -100,18 +98,3 @@ def dump_stack_frames(out=None): # pragma: debugging out = out or sys.stdout out.write(short_stack()) out.write("\n") - - -def pretty_data(data): - """Format data as JSON, but as nicely as possible. - - Returns a string. - - """ - # Start with a basic JSON dump. - out = json.dumps(data, indent=4, sort_keys=True) - # But pairs of numbers shouldn't be split across lines... - out = re.sub(r"\[\s+(-?\d+),\s+(-?\d+)\s+]", r"[\1, \2]", out) - # Trailing spaces mess with tests, get rid of them. - out = re.sub(r"(?m)\s+$", "", out) - return out |