views:

3489

answers:

6

I have already visited Preferred Python unit-testing framework. I am not just looking at Python Unit Testing Framework, but also code coverage with respect to unit tests. So far I have only come across coverage.py. Is there any better option?

An interesting option for me is to integrate cpython, unit testing of Python code and code coverage of Python code with Visual Studio 2008 through plugins (something similar to IronPython Studio). What can be done to achieve this? I look forward to suggestions.

+2  A: 

There is also figleaf which I think is based on Ned Batchelder's coverage.py. We use nose as the driver for the testing. It all works pretty well. We write our unit tests using the built-in unittest and doctest modules.

davidavr
+5  A: 

We use this Django coverage integration, but instead of using the default coverage.py reporting, we generate some simple HTML: Colorize Python source using the built-in tokenizer.

Tony Arkles
A: 

Testoob has a neat "--coverage" command-line option to generate a coverage report.

orip
Orip, which branch of Testoob has the --coverage option? I've 1.13 release currently installed, but it doesn't seem to have that option there.CheersH
Howard Sandford
Ah, ignore that. Wasn't reading the docs correctly.For other interested parties, use the following syntax:testoob --coverage=normal test_file.pytypes of coverage are silent, slim, normal, massive, or xml
Howard Sandford
@howard: glad you like it :) There's a new version with some coverage improvements coming out soon.
orip
+2  A: 

PyDev seems to allow code coverage from within Eclipse.

I've yet to find how to integrate that with my own (rather complex) build process, so I use Ned Batchelder's coverage.py at the command line.

Kena
I suggest a visit to http://stackoverflow.com/questions/2262777/how-to-get-unit-test-coverage-results-in-eclipse-pydev
bhadra
+2  A: 

NetBeans' new Python support has tightly integrated code coverage support - more info here.

Tor Norbye
A: 

If you want interactive code coverage, where you can see your coverage stats change in real time, take a look at Python Coverage Validator.

RikkiVernon