Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question
4  
Maybe you could define "better". What do you want to do that coverage.py doesn't do? How do you need it to be better? – Ned Batchelder Nov 7 '08 at 16:06
I was referring to Limitations (section 4 of nedbatchelder.com/code/modules/rees-coverage.html) when I mentioned "better". – bhadra Nov 9 '08 at 15:15
1  
I'd add that integration of coverage.py with IDEs (Eclipse, in my particular case) would be great. – Kena Nov 11 '08 at 22:17

6 Answers

up vote 3 down vote accepted

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.

share|improve this answer
1  
I suggest a visit to stackoverflow.com/questions/2262777/… – bhadra Jun 3 '10 at 15:54

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

share|improve this answer

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

share|improve this answer
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. Cheers H – Howard Sandford Feb 17 '09 at 15:19
Ah, ignore that. Wasn't reading the docs correctly. For other interested parties, use the following syntax: testoob --coverage=normal test_file.py types of coverage are silent, slim, normal, massive, or xml – Howard Sandford Feb 17 '09 at 15:27
@howard: glad you like it :) There's a new version with some coverage improvements coming out soon. – orip Feb 17 '09 at 16:34
@cfi - updated link – orip Apr 12 '12 at 10:06

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

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.