summaryrefslogtreecommitdiff
path: root/coverage/debug.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-08-24 07:42:48 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-08-24 07:42:48 -0400
commit7602b24930c45c097ec4c5266905a64a0e41f839 (patch)
treef26d3a36f01ba46d6b7ccba2d921271d80bde5b4 /coverage/debug.py
parent90f41ed049431bee8f5e5c09380823eb3c73c121 (diff)
downloadpython-coveragepy-git-7602b24930c45c097ec4c5266905a64a0e41f839.tar.gz
Data dumps can be canonicalized for comparison
Diffstat (limited to 'coverage/debug.py')
-rw-r--r--coverage/debug.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/coverage/debug.py b/coverage/debug.py
index 8ae087d7..8d6892bb 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