The trace module provides a powerful and easy tool to trace which lines of code were executed during a run.
Tracing can be used both to ensure testing coverage and to see the behavior of our software or third-party function.
The trace module provides a powerful and easy tool to trace which lines of code were executed during a run.
Tracing can be used both to ensure testing coverage and to see the behavior of our software or third-party function.
You need to perform the following steps for this recipe:
import trace
import collections
def report_tracing(func, *args, **kwargs):
outputs = collections.defaultdict(list)
tracing = trace.Trace(trace=False)
tracing.runfunc(func, *args, **kwargs)
traced = collections.defaultdict(set)
for filename, line...