Any tool for code coverage analysis on Python program

Skip Montanaro skip at pobox.com
Tue Jun 12 15:57:00 EDT 2001


    Edward> Hi I am trying t find a tol that do code analysis on program in
    Edward> python.  where can I find it?  I am using Python 1.5.2

Well, I once modified the code profiler to do statement coverage. Go here:

    http://musi-cal.mojam.com/~skip/python/

and search for "test coverage tool".  Take a look here:

    http://musi-cal.mojam.com/~skip/python/Python/dist/src/Lib/StringIO.py

to get an idea of the sort of output it generates.  At one point I was cvs
up'ing from the Python CVS repository each night and generating browsable C
and Python statement coverage output, which is available here:

    http://musi-cal.mojam.com/~skip/python/Python/dist/src/

This little project used the above Python statement coverage generator as
well as gprof and some glue scripts to generate the output you see.  It
wasn't perfect, but still useful.  I don't have the spare CPU cycles on that
machine anymore to bear the extra load.

If someone would like to resurrect that, let me know.

-- 
Skip Montanaro (skip at pobox.com)
(847)971-7098




More information about the Python-list mailing list