code coverage tool

John Roth johnroth at ameritech.net
Mon Mar 3 15:17:38 EST 2003


"Dave Brueck" <dave at pythonapocrypha.com> wrote in message
news:mailman.1046703425.1982.python-list at python.org...
> On Sun, 2 Mar 2003, John Roth wrote:
>
> > "Delaney, Timothy C (Timothy)" <tdelaney at avaya.com> wrote in message
> > news:mailman.1046651044.18286.python-list at python.org...
> > > From: Dave Brueck [mailto:dave at pythonapocrypha.com]
> > >
> > > On Fri, 28 Feb 2003, Delaney, Timothy C (Timothy) wrote:
> > >
> > > > > >phil hunt wrote:
> > > > > >>
> > > > > >> Is there an open-source code coverage tool for Python? I
have a
> > > > > >> program for which I have written sevewral unit tests,
> > > and I want to
> > > > > >> see if any of the lines in my program aren't being
> > > exercised by the
> > > > > >> tests.
> > > >
> > > > I'm still waiting for permission to release my coverage tool :(
> > > >
> > > > It's still incomplete, but it's faster than the other
> > > options I've tried
> > > > and collects more information.
> > >
> > > Does it work with multithreaded programs? Hope you get
> > > permission soon! :)
> >
> > Nah - unfortunately, that's one of the major parts that's incomplete
> > about it :( A python coverage tool which automatically attaches to
> > multiple threads is a non-trivial task.
> >
> > Of course, if I *do* get to release it (I'm waiting on a VP to sign
> > something off ...) then I could leave it to *someone else* to add
the
> > multi-threading part ;)
> >
> > Tim Delaney
> >
> > The first few messages seem not to have made it to my news server.
> > Look on the Vaults for PyCover. It mostly does what you
> > want, and if it doesn't, it's easy enough to change.
>
> No automatic support for multithreaded programs though, right?

I'm not sure what you mean by support for multi-threaded programs.
Python's threading model is to have the interpreter switch back
and forth between its "threads" using a byte code count, so I'd assume
that all you would need to do would be to put a monitor or something
equivalent in the trace exits.

As I said, this package is absurdly simple.

John Roth
>






More information about the Python-list mailing list