[ZODB-Dev] Re: ZODB test coverage
Jeremy Hylton
jeremy at zope.com
Tue Jul 15 19:52:56 EDT 2003
On Tue, 2003-07-15 at 14:37, Shane Hathaway wrote:
> Simon Michael wrote:
> > Toby Dickenson <tdickenson at geminidataloggers.com> writes:
> >
> >>Ive been reviewing the code coverage of the standard ZODB unit tests on
> >>DirectoryStorage, using the cvs trunks of both. Out of all the lines of code
> >
> >
> > Nice report - do you mind if I ask how you calculated this stuff ? Using
> > a tool, making sure every method has a unit test, every use case/corner
> > condition, or what ?
>
> The tool by Gareth Rees works well.
>
> http://www.garethrees.org/2001/12/04/python-coverage/coverage.py
There's also the trace module in the Python standard library starting
with Python 2.3. (It was in Tools/scripts in earlier Pythons.) The
Zope and ZODB test.py script is hooked up to use that module by using
the -T option.
"python test.py -T" will run the tests and produce annotated coverage
files in the cover directory. It will also print a summary of all
modules and percentage covered.
I added a little feature to the 2.3 version that deals with
multi-threaded apps that use the threading module.
Jeremy
More information about the ZODB-Dev
mailing list