26

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.

3
  • 6
    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? Nov 7, 2008 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, 2008 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, 2008 at 22:17

6 Answers 6

5

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.

4

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.

1
2

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.

2

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

1

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

0

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

3
  • 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 Feb 17, 2009 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 Feb 17, 2009 at 15:27
  • @howard: glad you like it :) There's a new version with some coverage improvements coming out soon.
    – orip
    Feb 17, 2009 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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