Python's NOSE testing framework has the concept of running multiple tests in parallel.
The purpose of this is not to test concurrency in the code, but to make tests for code that has "no side-effects, no ordering issues, and no external dependencies" run faster. The performance gain comes from concurrent I/O waits when they are accessing different devices, better use of multi CPUs/cores, and by running time.sleep() statements in parallel.
I believe the same thing could be done with Python's unittest testing framework, by having a plugin Test Runner.
Has anyone had any experience with such a beast, and can they make any recommendations?
You can override the
unittest.TestSuite
and implement some concurrency paradigm. Then, you use your customizedTestSuite
class just like normalunittest
. In the following example, I implement my customizedTestSuite
class usingasync
:In the
main
, I just construct my customizedTestSuite
classCustomTestSuite
, add all the test cases, and finally run it.