

def _driveWorker(self, worker, result, testCases, cooperate):
    '\n        Drive a L{LocalWorkerAMP} instance, iterating the tests and calling\n        C{run} for every one of them.\n\n        @param worker: The L{LocalWorkerAMP} to drive.\n\n        @param result: The global L{DistReporter} instance.\n\n        @param testCases: The global list of tests to iterate.\n\n        @param cooperate: The cooperate function to use, to be customized in\n            tests.\n        @type cooperate: C{function}\n\n        @return: A C{Deferred} firing when all the tests are finished.\n        '

    def resultErrback(error, case):
        result.original.addFailure(case, error)
        return error

    def task(case):
        d = worker.run(case, result)
        d.addErrback(resultErrback, case)
        return d
    return cooperate((task(case) for case in worker)).whenDone()

dataset/ETHPy150Open twisted/twisted/twisted/trial/_dist/disttrial.py DistTrialRunner._driveWorker/VarMisuse@90/311 `testCases`->`worker`