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

  • 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 :)


Note that in pydev 2.0, the coverage support changed, now, you should first open the coverage view and select the 'enable code coverage for new launches'... after that, any launch you do (regular or unit-test) will have coverage information being gathered (and the results inspection also became a bit more intuitive).