Search code examples
pythoneclipsecode-coveragepydev

How to get unit test coverage results in Eclipse + Pydev?


I know Eclipse + PyDev has an option Run As => 3 Python Coverage. But all it reports is:

Ran 6 tests in 0.001s

OK

And it says nothing about code coverage. How to get a code coverage report in Pydev?


Solution

    • Run a file with "Python Coverage"
    • Window > Show View > Code Coverage Results View
    • Select the directory in which the executed file is
    • Double-click on the executed file in the file list
    • Statistics are now at the right, not executed lines are marked red in the code view

    Actually this is a really nice feature, didn't know about it before :)