def test_deprectated(caplog): with caplog.at_level(logging.WARNING): Parallel(mock.Mock(), mock.Mock(), mock.Mock()) assert len(caplog.records) == 1 assert caplog.records[0].levelname == 'WARNING' assert 'parallel' in caplog.records[0].name assert 'deprecated' in caplog.records[0].msg
def _build_parallel_multiprocessing(quiet, processes): if processes is None or processes == 0: communicationChannel = concurrently.CommunicationChannel0( progressbar=not quiet) else: dropbox = concurrently.MultiprocessingDropbox(processes, progressbar=not quiet) communicationChannel = concurrently.CommunicationChannel( dropbox=dropbox) return Parallel(None, communicationChannel)
def _build_parallel_dropbox_(workingarea_options, dropbox_options, dispatcher_class, dispatcher_options): workingarea = concurrently.WorkingArea(**workingarea_options) dispatcher = dispatcher_class(**dispatcher_options) dropbox_options.update(dict(workingArea=workingarea, dispatcher=dispatcher)) dropbox = concurrently.TaskPackageDropbox(**dropbox_options) communicationChannel = concurrently.CommunicationChannel(dropbox=dropbox) return Parallel(None, communicationChannel, workingarea)
def _build_parallel_multiprocessing(quiet, processes): if quiet: progressBar = None elif sys.stdout.isatty(): progressBar = progressbar.ProgressBar() else: progressBar = progressbar.ProgressPrint() if processes is None or processes == 0: progressMonitor = progressbar.NullProgressMonitor( ) if quiet else progressbar.ProgressMonitor(presentation=progressBar) communicationChannel = concurrently.CommunicationChannel0() else: progressMonitor = progressbar.NullProgressMonitor( ) if quiet else progressbar.BProgressMonitor(presentation=progressBar) dropbox = concurrently.MultiprocessingDropbox(processes, progressMonitor) communicationChannel = concurrently.CommunicationChannel( dropbox=dropbox) return Parallel(progressMonitor, communicationChannel)
def obj(communicationChannel, workingarea): return Parallel(progressMonitor=None, communicationChannel=communicationChannel, workingarea=workingarea)