diff options
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. |