| Linux & OSX | Windows |
|---|---|
Example of a deferrable testcase.
DeferrableTestCase is used to write the test cases. They are executed by the DeferringTextTestRunner and the runner expects not only regular test functions, but also generators. If the test function is a generator, it does the following
-
if the yielded object is a callable, the runner will evaluate the callable and check its returned value. If the result is
True, the runner continues the generator, if not, the runner will wait until the condition is met. -
If the yielded object is an integer, say
x, then it will continue the generator afterxms. -
Otherwise, the
yieldstatement will always wait for 10 ms.