artemp/tickets2issues — Issue #384: Improve tests
Author: artemp
Created: 2011-10-11 15:14:09+00:00
State: open
Labels: Core_Library

We should improve the tests to achieve these goals:

* Achieve a very high level of code coverage through unit tests
* Make it easy for people to write and contribute tests
* Make it easy to run all tests before each commit and after each build
* Make it easy to integrate testing into a buildbot
* Validate the code examples that appear in the Trac wiki

I propose using the 'nose' library which is a test discovery engine based on unittest (and in fact which will run unittest TestCases without modification).

Nose offers things like test generators (defining a test and using a loop and 'yield' to create subtests for different arguments) and automatic discovery of tests through the source tree.

It also offers output capture for failures and is widely used.

Nose lives here: http://somethingaboutorange.com/mrl/projects/nose/

You can install it easily:

{{{
# easy_install nose
}}}

And run it easily:

{{{
# nosetests --exe -v
}}}

('--exe' is used to include files which are executable, which are excluded by default. Our tests are currently executable.)