[ZODB-Dev] Re: ZODB test coverage

Shane Hathaway shane at zope.com
Tue Jul 15 15:37:54 EDT 2003


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

You let "python coverage.py -x" execute your unit tests.  It installs a 
trace hook to receive line number notifications.  Before Python exits, 
coverage.py writes the collected data to a file in the current directory 
called ".coverage".  Then you run something like the following to see 
what your unit tests missed:

find . -name '*.py' | xargs python coverage.py -r -m

Shane




More information about the ZODB-Dev mailing list