Amandasaurus
Amandasaurus

Reputation: 60809

Generate test coverage information from pyunit unittests?

I have some pyunit unit tests for a simple command line programme I'm writing. Is it possible for me to generate test coverage numbers? I want to see what lines aren't being covered by my tests.

Upvotes: 4

Views: 2288

Answers (2)

orip
orip

Reputation: 75557

If you run your tests with testoob you can get a coverage report with --coverage. Can install with easy_install. No changes to your tests necessary:

testoob alltests.py --coverage

Upvotes: 1

Alex Martelli
Alex Martelli

Reputation: 882751

I regularly use Ned Batchelder's coverage.py tool for exactly this purpose.

Upvotes: 9

Related Questions