Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nosetests & Combined Coverage

I have many projects that I'm programatically running:

nosetest --with-coverage --cover-html-dir=happy-sauce/

The problem is that for each project, the coverage module overwrites the index.html file, instead of appending to it. Is there a way to generate a combined super-index.html file, that contains the results for all my projects?

Thanks.

like image 724
sholsapp Avatar asked Sep 08 '11 17:09

sholsapp


2 Answers

You can't combine the HTML directories. You can combine the .coverage data files, but you'll have to use coverage directly, rather than through nose:

$ nosetest --with-coverage proj1
$ mv .coverage .coverage.1
$ nosetest --with-coverage proj2
$ mv .coverage .coverage.2
$ coverage combine
(combines .coverage.1 and .coverage.2 into a new .coverage)
$ coverage html --directory=happy-sauce
like image 198
Ned Batchelder Avatar answered Oct 25 '22 11:10

Ned Batchelder


nosetests --with-coverage -i project1/*.py -i project2/*.py

like image 29
starzmasta Avatar answered Oct 25 '22 11:10

starzmasta