traceback.extract_tb()

traceback.extract_tb(tb, limit=None) Return a list of “pre-processed” stack trace entries extracted from the traceback object tb. It is useful for alternate formatting of stack traces. The optional limit argument has the same meaning as for print_tb(). A “pre-processed” stack trace entry is a 4-tuple (filename, line number, function name, text) representing the information that is usually printed for a stack trace. The text is a string with leading and trailing whitespace stripped; if the so

traceback.extract_stack()

traceback.extract_stack(f=None, limit=None) Extract the raw traceback from the current stack frame. The return value has the same format as for extract_tb(). The optional f and limit arguments have the same meaning as for print_stack().

traceback.clear_frames()

traceback.clear_frames(tb) Clears the local variables of all the stack frames in a traceback tb by calling the clear() method of each frame object. New in version 3.4.

trace.Trace.runfunc()

runfunc(func, *args, **kwds) Call func with the given arguments under control of the Trace object with the current tracing parameters.

trace.Trace.runctx()

runctx(cmd, globals=None, locals=None) Execute the command and gather statistics from the execution with the current tracing parameters, in the defined global and local environments. If not defined, globals and locals default to empty dictionaries.

trace.Trace.run()

run(cmd) Execute the command and gather statistics from the execution with the current tracing parameters. cmd must be a string or code object, suitable for passing into exec().

trace.Trace.results()

results() Return a CoverageResults object that contains the cumulative results of all previous calls to run, runctx and runfunc for the given Trace instance. Does not reset the accumulated trace results.

trace.Trace

class trace.Trace(count=1, trace=1, countfuncs=0, countcallers=0, ignoremods=(), ignoredirs=(), infile=None, outfile=None, timing=False) Create an object to trace execution of a single statement or expression. All parameters are optional. count enables counting of line numbers. trace enables line execution tracing. countfuncs enables listing of the functions called during the run. countcallers enables call relationship tracking. ignoremods is a list of modules or packages to ignore. ignoredi

trace.CoverageResults.write_results()

write_results(show_missing=True, summary=False, coverdir=None) Write coverage results. Set show_missing to show lines that had no hits. Set summary to include in the output the coverage summary per module. coverdir specifies the directory into which the coverage result files will be output. If None, the results for each source file are placed in its directory.

trace.CoverageResults.update()

update(other) Merge in data from another CoverageResults object.