diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-20 07:02:12 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-20 07:02:12 -0500 |
commit | 741e21203b77547906babf0f04edf7eb5dedf723 (patch) | |
tree | e6f2350497fad7c57d1aed9e4a47b7db105f0940 /coverage/misc.py | |
parent | 3349880afb9409cc052066a8f7688ca5e305693e (diff) | |
download | python-coveragepy-git-741e21203b77547906babf0f04edf7eb5dedf723.tar.gz |
Debugging to understand why 'trace function changed' appears.
Diffstat (limited to 'coverage/misc.py')
-rw-r--r-- | coverage/misc.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/coverage/misc.py b/coverage/misc.py index 3ed854a7..b4d1c833 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -54,6 +54,12 @@ def format_lines(statements, lines): return ret +def short_stack(): + """Return a string summarizing the call stack.""" + stack = inspect.stack()[:0:-1] + return "\n".join("%30s : %s @%d" % (t[3],t[1],t[2]) for t in stack) + + def expensive(fn): """A decorator to cache the result of an expensive operation. |