示例#1
0
def test_close_scheduler():
    s = Scheduler()
    s.close()
    assert s.pool._state == multiprocessing.pool.CLOSE
    assert not s._listen_to_clients_thread.is_alive()
    assert not s._listen_to_workers_thread.is_alive()
    assert s.context.closed
示例#2
0
def test_random_names():
    s = Scheduler()

    try:
        assert s.address_to_workers
        assert s.address_to_clients
        assert s.address_to_clients != s.address_to_workers
        assert re.match('\w+://.+:\d+', s.address_to_workers.decode('utf-8'))
    finally:
        s.close()
示例#3
0
def scheduler():
    s = Scheduler()
    try:
        yield s
    finally:
        s.close()
示例#4
0
def scheduler(kwargs={}):
    s = Scheduler(hostname='127.0.0.1', **kwargs)
    try:
        yield s
    finally:
        s.close()