From 50a6da994e8bd931b18721da8c60acfbb13d4685 Mon Sep 17 00:00:00 2001 From: Yann Sionneau Date: Thu, 4 Jun 2015 13:44:07 +0200 Subject: [PATCH] worker test: do not close the event loop twice --- artiq/test/worker.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/artiq/test/worker.py b/artiq/test/worker.py index a72547b8b..fede84dfd 100644 --- a/artiq/test/worker.py +++ b/artiq/test/worker.py @@ -40,21 +40,18 @@ def _call_worker(worker, expid): def _run_experiment(experiment): - try: - expid = { - "file": sys.modules[__name__].__file__, - "experiment": experiment, - "arguments": dict() - } - handlers = { - "init_rt_results": lambda description: None - } + expid = { + "file": sys.modules[__name__].__file__, + "experiment": experiment, + "arguments": dict() + } + handlers = { + "init_rt_results": lambda description: None + } - loop = asyncio.get_event_loop() - worker = Worker(handlers) - loop.run_until_complete(_call_worker(worker, expid)) - finally: - loop.close() + loop = asyncio.get_event_loop() + worker = Worker(handlers) + loop.run_until_complete(_call_worker(worker, expid)) class WatchdogCase(unittest.TestCase):