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
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()
def scheduler(): s = Scheduler() try: yield s finally: s.close()
def scheduler(kwargs={}): s = Scheduler(hostname='127.0.0.1', **kwargs) try: yield s finally: s.close()