Example #1
0
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
Example #2
0
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)
Example #3
0
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)
Example #4
0
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)
Example #5
0
def obj(communicationChannel, workingarea):
    return Parallel(progressMonitor=None,
                    communicationChannel=communicationChannel,
                    workingarea=workingarea)