v3.4 beta 1

Saturday 21 August 2010 v3.4 beta 1 is available now. 3.4 brings improved source code specification. The --omit and --include switches have changed in an incompatible way, taking file patterns rather than prefixes, and a new --source switch specifies directories or modules to measure. Details are in the new page about specifying source files in the docs. These changes should help people focus on the code they really want to measure.

In addition, a few bug fixes have helped in this area: Jinja templates and doctest bodies are no longer measured, since they produced errors during reporting anyway.

One other notable change: used to report the number of statements, and the number of executed statements. Now instead of executed statements, it reports missed statements. This is a better indicator of how well your code is covered, because it’s clear what the goal is: zero missed statements.

Give this version a try. There have been lots of changes. Also, I hate to admit it: but this version has broken my own coverage measurement of itself, and I haven’t figured out why yet...


pankaj 5:02 AM on 22 Aug 2010

Hi Ned,
I've used lot of your works including, thanks a lot for it.
I'm developing a software in cython. After a lot of searching i could not find a way to get coverage of cython files.
Do you have any idea about it or maybe point me in the right direction so that i may add hooks to to get it to report cython files' coverage also.
If line coverage is not possible at least function coverage would be a nice addition :)

Ned Batchelder 12:57 PM on 22 Aug 2010

@Pankaj: I've never used Cython, but my understanding is that it compiles to .c files, which are then compiled and run. won't be able to help measure inside .c code. Perhaps gcov?

pankaj 12:57 AM on 23 Aug 2010

Thanks for your reply.
I know cant help with the c files, but cython actually generates code to hook to python profilers (cProfile) so that cProfile can report cython function calls in its report. Maybe there's some way to make get this information and report which functions in the cython files are covered.
So i'd like to know how coverage does it (some documentation/source) and some pointers as to where do i dig into its source to be able to modify it to report such information. I think it will be a nice feature.
Thanks again.

John C 10:38 AM on 25 Aug 2010

Thanks Ned and keep up the excellent work: rocks :-)

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.