class documentation

class ParallelTestSuite(unittest.TestSuite):

View In Hierarchy

Run a series of tests in parallel in several processes.

While the unittest module's documentation implies that orchestrating the execution of tests is the responsibility of the test runner, in practice, it appears that TestRunner classes are more concerned with formatting and displaying test results.

Since there are fewer use cases for customizing TestSuite than TestRunner, implementing parallelization at the level of the TestSuite improves interoperability with existing custom test runners. A single instance of a test runner can still collect results from all tests without being aware that they have been run in parallel.

Method __init__ Undocumented
Method __iter__ Undocumented
Method run Distribute test cases across workers.
Instance Variable buffer Undocumented
Instance Variable failfast Undocumented
Instance Variable processes Undocumented
Instance Variable subsuites Undocumented
def __init__(self, subsuites, processes, failfast=False, buffer=False):

Undocumented

def __iter__(self):

Undocumented

def run(self, result):

Distribute test cases across workers.

Return an identifier of each test case with its result in order to use imap_unordered to show results as soon as they're available.

To minimize pickling errors when getting results from workers:

  • pass back numeric indexes in self.subsuites instead of tests
  • make tracebacks picklable with tblib, if available

Even with tblib, errors may still occur for dynamically created exception classes which cannot be unpickled.

buffer =

Undocumented

failfast =

Undocumented

processes =

Undocumented

subsuites =

Undocumented