Code coverage to Python code

David Stanek dstanek at dstanek.com
Mon Jan 5 04:20:44 CET 2009


On Sun, Jan 4, 2009 at 9:26 PM, Roy Smith <roy at panix.com> wrote:
> In article <mailman.6574.1231108877.3487.python-list at python.org>,
>  Robert Kern <robert.kern at gmail.com> wrote:
>
>> Hussein B wrote:
>> > Hey,
>> > What is the best code coverage tool available for Python?
>>
>> I like Titus Brown's figleaf.
>>
>> http://darcs.idyll.org/~t/projects/figleaf/doc/
>
> I was playing with Ned Batchelder's coverage.py module today.  Once I
> stopped screwing around trying to get the "easy install" stuff to work and
> just copied the danged .py file to my site-packages directory, I was up and
> running in a few minutes.
>
> I suppose there's a lot of bells and whistles you could add, but it ran my
> code and told me which lines had executed and which hadn't.  That pretty
> much seems like what you want a code coverage tool to do.
>
> http://nedbatchelder.com/code/modules/coverage.html

It will show lines as covered when they are executed by the
interpreter. Class statements, function definitions, etc. can show up
as executed. Are you seeing other code show up as covered?

<shameless_self_promotion>
Recently I pushed a branch of an experimental project I am calling
Barbarian[0]. It uses nose, figleaf and pylint to generate HTML for a
project. A blog post with a more detailed description will be posted
within a few days.

[0] http://code.launchpad.net/~dstanek/+junk/Barbarian
</shameless_self_promotion>

-- 
David
http://www.traceback.org



More information about the Python-list mailing list