(devel) a note about automated tests and how we're going to do them moving forward

Michael DeHaan mdehaan at redhat.com
Thu Oct 16 19:01:32 UTC 2008


I've switching "make test" to call unit tests via nose, which produces 
some nicer output from the same test code.

To get nose, you'll need to:

    # yum install nose

Nose can also be called with coverage if you uncomment that part of the 
Makefile.

    # easy_install coverage

While currently a lot of tests exist in tests/test.py the intent is for 
new tests to live with the code, so that they have a greater hope of 
being maintained when folks add features (since they will obviously be 
in the same file).  

For instance, XMLRPC tests will live in remote.py.

Nose allows for tests to be named "test_something" and it will find 
functions of that form and see if any asserts in them fail.

For instance:

    assert x == 2, "verify that the return code is two"

Another nice feature of nose is that when running "make test" the output 
is a lot nicer, it will only show stdout/stderr for tests that actually 
fail, so there's a lot less noise to sift through.

--Michael




More information about the fedora-devel-list mailing list