From 790b811ed26cce28beb6c03affe68f56109cc025 Mon Sep 17 00:00:00 2001 From: xjules Date: Thu, 19 Dec 2024 13:13:54 +0100 Subject: [PATCH] Ruff fixes --- src/ert/ensemble_evaluator/evaluator.py | 4 ++-- tests/ert/utils.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ert/ensemble_evaluator/evaluator.py b/src/ert/ensemble_evaluator/evaluator.py index a502652f77f..fc1a3e11556 100644 --- a/src/ert/ensemble_evaluator/evaluator.py +++ b/src/ert/ensemble_evaluator/evaluator.py @@ -388,10 +388,10 @@ async def _monitor_and_handle_tasks(self) -> None: raise task_exception elif task.get_name() == "server_task": return - elif task.get_name() == "ensemble_task" or task.get_name() in [ + elif task.get_name() == "ensemble_task" or task.get_name() in { "ensemble_task", "listener_task", - ]: + }: timeout = self.CLOSE_SERVER_TIMEOUT else: msg = ( diff --git a/tests/ert/utils.py b/tests/ert/utils.py index 1665ac4e0a5..bb79072f93c 100644 --- a/tests/ert/utils.py +++ b/tests/ert/utils.py @@ -115,11 +115,10 @@ async def _handler(self): while True: try: dealer, __, frame = await self.router_socket.recv_multipart() - print(f"{dealer=} {frame=} {self.value=}") frame = frame.decode("utf-8") - if frame in [CONNECT_MSG, DISCONNECT_MSG] or self.value == 0: + if frame in {CONNECT_MSG, DISCONNECT_MSG} or self.value == 0: await self.router_socket.send_multipart([dealer, b"", ACK_MSG]) - if frame not in [CONNECT_MSG, DISCONNECT_MSG] and self.value != 1: + if frame not in {CONNECT_MSG, DISCONNECT_MSG} and self.value != 1: self.messages.append(frame) except asyncio.CancelledError: break