Frage

I've got a python program which is tested by running it several times with different inputs, and comparing the outputs against reference results.

I'd like to get code coverage of all the tests combined, so I can see if there are extra sets of inputs I should be using to get complete coverage. I've looked at the coverage module but can't work out how I can make it do this.

Any clues?

War es hilfreich?

Lösung

Ned Batchelder's coverage.py has a feature to combine the results of multiple runs, which seems to be exactly what you are looking for.

Andere Tipps

If running on the same machine, run it with the -a option, which accumulates coverage data across multiple calls.

Example:

coverage erase

coverage run -a <command> [arguments, ...]

coverage run -a <command> ... # repeat as many times as needed.

coverage report

coverage html

doc: http://coverage.readthedocs.org/en/latest/cmd.html#data-file

Hope this helps.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top