class documentation

class DistTrialRunner: (source)

View In Hierarchy

A specialized runner for distributed trial. The runner launches a number of local worker processes which will run tests.
Method __init__ Undocumented
Method create​Local​Workers Create local worker protocol instances and return them.
Method launch​Worker​Processes Spawn processes from a list of process protocols.
Method run Spawn local worker processes and load tests. After that, run them.
Method run​Until​Failure Run the tests with local worker processes until they fail.
Method write​Results Write test run final outcome to result.
Method _drive​Worker Drive a LocalWorkerAMP instance, iterating the tests and calling run for every one of them.
Method _make​Result Make reporter factory, and wrap it with a DistReporter.
Instance Variable _log​File Undocumented
Instance Variable _log​File​Object Undocumented
Instance Variable _log​File​Observer Undocumented
Instance Variable _log​Warnings Undocumented
Instance Variable _reporter​Factory the reporter class to be used.
Instance Variable _result Undocumented
Instance Variable _rterrors Undocumented
Instance Variable _stream stream which the reporter will use.
Instance Variable _tbformat Undocumented
Instance Variable _unclean​Warnings Undocumented
Instance Variable _worker​Arguments Undocumented
Instance Variable _worker​Number the number of workers to be spawned.
Instance Variable _working​Directory Undocumented
def __init__(self, reporterFactory, workerNumber, workerArguments, stream=None, tracebackFormat='default', realTimeErrors=False, uncleanWarnings=False, logfile='test.log', workingDirectory='_trial_temp'): (source)

Undocumented

def createLocalWorkers(self, protocols, workingDirectory): (source)
Create local worker protocol instances and return them.
Parameters
protocolsAn iterable of LocalWorkerAMP instances.
working​Directory:strThe base path in which we should run the workers.
Returns
A list of quantity LocalWorker instances.
def launchWorkerProcesses(self, spawner, protocols, arguments): (source)
Spawn processes from a list of process protocols.
Parameters
spawnerA IReactorProcess.spawnProcess implementation.
protocolsAn iterable of ProcessProtocol instances.
argumentsExtra arguments passed to the processes.
def run(self, suite, reactor=None, cooperate=cooperate, untilFailure=False): (source)
Spawn local worker processes and load tests. After that, run them.
Parameters
suiteA tests suite to be run.
reactor:A provider of twisted.internet.interfaces.IReactorProcessThe reactor to use, to be customized in tests.
cooperate:functionThe cooperate function to use, to be customized in tests.
until​Failure:bool.If True, continue to run the tests until they fail.
Returns
DistReporterThe test result.
def runUntilFailure(self, suite): (source)
Run the tests with local worker processes until they fail.
Parameters
suiteA tests suite to be run.
def writeResults(self, result): (source)
Write test run final outcome to result.
Parameters
resultA TestResult which will print errors and the summary.
def _driveWorker(self, worker, result, testCases, cooperate): (source)
Drive a LocalWorkerAMP instance, iterating the tests and calling run for every one of them.
Parameters
workerThe LocalWorkerAMP to drive.
resultThe global DistReporter instance.
test​CasesThe global list of tests to iterate.
cooperate:functionThe cooperate function to use, to be customized in tests.
Returns
A Deferred firing when all the tests are finished.
def _makeResult(self): (source)
Make reporter factory, and wrap it with a DistReporter.
_logFile = (source)

Undocumented

_logFileObject = (source)

Undocumented

_logFileObserver = (source)

Undocumented

_logWarnings: bool = (source)

Undocumented

_reporterFactory = (source)
the reporter class to be used.
_result = (source)

Undocumented

_rterrors = (source)

Undocumented

_stream = (source)
stream which the reporter will use.
_tbformat = (source)

Undocumented

_uncleanWarnings = (source)

Undocumented

_workerArguments = (source)

Undocumented

_workerNumber: int = (source)
the number of workers to be spawned.
_workingDirectory = (source)

Undocumented