Sancho

Sancho contains the lean unit test module that we use at the MEMS Exchange.

Sancho runs tests, and provides output for tests that fail.

Sancho does not count tests passed or failed. The target is projects that do not maintain failing tests.

Usage

The pattern we follow is to write unittests in separate python files whose names all start with "utest_". Each script has one or more subclasses of sancho.utest.UTest defined, and the script ends by calling the constructors of each of these classes.

The UTest constructor runs every method method of the subclass (except for those whose names start with "_") as a test. Any test that raises any exception will cause output, but other output from tests is suppressed. If all tests in a class have common setup and shutdown code, you can put these in _pre and _post methods and the UTest will call them before and after each test.

You can run the tests directly or use the included urun.py program to run all of the utest_ scripts below the current directory.

DurusWorks Documentation