Friday, December 10, 2010

Improved unittest support in Pydev

Pydev 1.6.4 is still not released, but the first nightly with the new support for unittest is now available (see on instructions for getting the nightly).

The major features added are:

1. A PyUnit view is now available to show the results of unittests
2. The nose and Py.test test runners are now also supported

The interesting features related to seeing the tests are:

- The results of tests are shown, along with a green/red bar (or if you're with Aptana Studio, following the color theme)
- The time a test took to run is shown (and may be used to sort the tree)
- The errors/output are shown by selecting the test run or just hovering over the items
- A filter to show only errors is available

And there are some interesting actions in that view too:

- A test session can be rerun
- A new test session can be created to rerun only the errors of the current run
- The test session can be stopped
- The results of a previously run test session can be seen again

And at last (but not least), the test runner can now be configured, so, one can use the test runner bundled in Pydev, Nose or Py.Test.

The preferences page to configure it can be accessed in the 'Configure test runner preferences' in the PyUnit view.