Description
MultiTest expands unit-testing in python to highlight possible test errors due to differences in platforms and/or in a particular version of some other dependency.Types of errors
The types of errors that multitest can highlight, with a number of clients setup, include;
- differences in versions of python or 3rd party modules,
- an unavailable module,
- file-system layout and limitations,
- other assumptions based on platform specifics.
As a simple, contrived, example the following test will fail on most MS-Windows systems but succeed on Linux,
self.assert_(os.path.exists("/etc"))
Usage
Writing unit-tests
Multitest will run any unit-test module that contains sub-classes of unittest.TestCase.
An example unit-test module;import unittest class Tests(unittest.TestCase): def testSuccess(self): self.assertEqual(1, 1) def testFailure(self): self.assertEqual(1, 0) def testError(self): raise Exception() self.assertEqual(1, 1) # Never gets here. if __name__ == '__main__': unittest.main()Sample unit-tests are available under the multitest/tests sub-folder. These include,
- multitest.tests.basic - 3 tests that result in 1 success, 1 failure and 1 error. Use to check multitest and its clients work.
- multitest.tests.filesystem - File system tests that will show different results from clients running on different platforms.
./runtest.py test.test_base64
Running the tests
- Make sure each client has a copy of your test files.
- Run client.py on each computer you wants to run your tests on.
-
Use runtest.py to specify the clients and the unit-test module to run. For example,
./runtest.py --clients localhost,192.168.0.2 multitest.tests.basic
- View the results.
What client environments to setup
A recommended minimum set of test clients will include,- Your current workstation.
- At least one test client running a version of python from each major python version you want to support (eg; 2.3.4 and 2.4.2).
- At least one test client per platform you want to support (eg; BSD, Linux, MacOSX, MS-Windows).
Download
multitest-0.1.0.tar.bz2 - 9k