Trees | Indices | Help |
|
---|
|
object --+ | TestSuite
A small and tight class designed for unit tests.
With this utility, unit test code can be written much faster than with the 'unittest' module.
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
Sets the title of the suite to 'title' and all internal counters to 0.
|
Adds a case into the suite. Each case must be a tuple of at least two elements:
If there are more than two elements, the remaining elements will be printed or called (if callable) if the test is failed. This helps diagnose the problem. |
Performs testing of all test cases accumulated so far and print information indicating a particular case is passed or failed. The user can explicitly call this function as many times as like. Already tested cases will not be tested again. This means that the user can do something like this: tsuite = TestSuite( 'util' ) ... tsuite << case1 tsuite.run() # Testing of 'case1' will be performed tsuite.run() # Allowed, but meaningless since 'case1' will be tested again. and so this: tsuite << case1 tsuite.run() tsuite << case1 tsuite.run() # Allowed. The 'tsuite' takes the 2nd 'case1' as a new case and performs the testing. The user usually does NOT need to call this function explicitly because when the 'TestSuite' object is about to be destructed, it will automatically check and test any untested cases. |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Aug 6 04:50:33 2015 | http://epydoc.sourceforge.net |