[TIP] new (python 2.6) fn: gettrace

Titus Brown titus at caltech.edu
Wed Jan 23 19:55:04 PST 2008


On Wed, Jan 23, 2008 at 03:34:16PM -0700, m h wrote:
-> On Jan 23, 2008 3:21 PM, Titus Brown <titus at caltech.edu> wrote:
-> >
-> > On Wed, Jan 23, 2008 at 03:18:44PM -0700, m h wrote:
-> > -> On Jan 23, 2008 1:39 PM, Titus Brown <titus at caltech.edu> wrote:
-> > -> > 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:
-> > -> >
-> > -> >         http://bugs.python.org/issue1648
-> > ->
-> > -> I was crossing my fingers that this might provide more granularity
-> > -> than line level coverage....
-> > ->
-> > -> I guess I need to file a bug...
-> >
-> > Explain?
-> 
-> If you want to do path coverage you need to be able to mark every path
-> through the code.
-> The current method of line coverage doesn't allow one to trace short
-> circuiting in boolean operations.

OK, that's what I thought you meant -- but (to be pedantic) describing
a feature request as a "bug" is a bit confusing ;).

I don't know how hard this would be to add to Py 2.6 or Py 3k, but
regardless my guess is that you would need to do it yourself. You
*could* propose it as a GSoC project...

Hmm, or we could sit down and try to hack it out at PyCon.  That might
be a fun way to spend an evening or two!

cheers,
--titus



More information about the testing-in-python mailing list