December 13, 2009

Get XML coverage reports from nose

When hook­ing up Hudson and Django, I needed a way to get XML cov­er­age reports.

At the time I forked nose itself, but I wasn’t happy with the solu­tion. Folks rightly wouldn’t want to use my fork; I don’t want to commit to keep­ing up with nose’s devel­op­ment; and duh, they have a plugin archi­tec­ture.

So I’m happy to announce nose-​xcover. Install it and it’ll add the –with-​xcoverage option which you can use along­side the built-​in plugin like so:

#nosetests --with-coverage {{ coverage options }} --with-xcoverage
nosetests --with-coverage --cover-package=myapp --cover-tests --with-xcoverage

I updated my Django and Hudson guide to use this instead of the fork.

I hope you find it useful!

Filed under: Django,Projects,Python

Next:
Previous:

Related

Comments