[TIP] new (python 2.6) fn: gettrace

Titus Brown titus at caltech.edu
Wed Jan 23 12:39:26 PST 2008

Hi folks,

I thought code coverage aficionados might be interested to hear that a
new function, sys.gettrace, has been added into python 2.6:


This will help immeasurably with having testing tools not step on each
other -- in particular, it allows trace functions to intelligently
override, or include, or restore, other trace functions.

I hope that both nose and py.test can wrap individual tests in trace
save/restore code, too; that way if code-under-test mucks with the trace
function, the testing framework will handle it nicely.


More information about the testing-in-python mailing list