'Override testing hook to create a deterministic threadpool.
@param currentLimit: A 1-argument callable which returns the current
threadpool size limit.
@param threadFactory: ignored in this invocation; a 0-argument callable
that would produce a thread.
@return: a L{Team} backed by the coordinator and worker passed to
L{MemoryPool.__init__}.'

def _pool(self, currentLimit, threadFactory):

    def respectLimit():
        stats = team.statistics()
        if ((stats.busyWorkerCount + stats.idleWorkerCount) >= currentLimit()):
            return None
        return self._newWorker()
    team = Team(coordinator=self._coordinator, createWorker=respectLimit, logException=self._failTest)
    return team
