From 79b680f3990f6bd22ce4122785e322b6ebcf53b1 Mon Sep 17 00:00:00 2001 From: xjules Date: Tue, 10 Dec 2024 15:56:13 +0100 Subject: [PATCH] More cleanups --- .github/workflows/test_ert.yml | 6 --- src/ert/ensemble_evaluator/_ensemble.py | 5 +- .../unit_tests/ensemble_evaluator/conftest.py | 46 ------------------- 3 files changed, 3 insertions(+), 54 deletions(-) diff --git a/.github/workflows/test_ert.yml b/.github/workflows/test_ert.yml index 07601272254..bca318e5a42 100644 --- a/.github/workflows/test_ert.yml +++ b/.github/workflows/test_ert.yml @@ -33,12 +33,6 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v4 - - name: Install dependencies on macOS - if: ${{ inputs.os == 'macos-latest' }} - run: | - echo "On macOS we need to install zeromq" - brew install zeromq - - name: Install ert run: | uv pip install ".[dev, everest]" diff --git a/src/ert/ensemble_evaluator/_ensemble.py b/src/ert/ensemble_evaluator/_ensemble.py index ad97ff21daa..42058c18739 100644 --- a/src/ert/ensemble_evaluator/_ensemble.py +++ b/src/ert/ensemble_evaluator/_ensemble.py @@ -291,8 +291,9 @@ async def _evaluate_inner( # pylint: disable=too-many-branches except Exception as exc: logger.exception( ( - "Unexpected exception in ensemble: \n" - "".join(traceback.format_exception(None, exc, exc.__traceback__)) + "Unexpected exception in ensemble: \n" "".join( + traceback.format_exception(None, exc, exc.__traceback__) + ) ), exc_info=True, ) diff --git a/tests/ert/unit_tests/ensemble_evaluator/conftest.py b/tests/ert/unit_tests/ensemble_evaluator/conftest.py index 0f461d1917c..eda4a55b27a 100644 --- a/tests/ert/unit_tests/ensemble_evaluator/conftest.py +++ b/tests/ert/unit_tests/ensemble_evaluator/conftest.py @@ -17,52 +17,6 @@ from ert.storage import Ensemble from tests.ert import SnapshotBuilder -# @pytest.fixture(name="zmq_server") -# def _mock_zmq_server(host, port, messages, delay_startup=0): -# loop = new_event_loop() -# done = loop.create_future() - -# async def _handler(router_socket): -# while True: -# _, __, *frames = await router_socket.recv_multipart() -# for frame in frames: -# raw_msg = frame.decode("utf-8") -# messages.append(raw_msg) -# if raw_msg == "stop": -# done.set_result(None) -# break - -# async def _run_server(): -# await asyncio.sleep(delay_startup) -# zmq_context = zmq.asyncio.Context() # type: ignore -# router_socket = zmq_context.socket(zmq.ROUTER) -# router_socket.bind(f"tcp://*:{port}") -# handler_task = asyncio.create_task(_handler(router_socket)) -# await handler_task -# router_socket.close() - -# loop.run_until_complete(_run_server()) -# loop.close() - - -# @pytest.fixture(name="async_zmq_server") -# def _async_mock_zmq_server(port, handler, set_when_done): -# loop = new_event_loop() - -# async def _run_server(): -# zmq_context = zmq.asyncio.Context() # type: ignore -# router_socket = zmq_context.socket(zmq.ROUTER) -# router_socket.bind(f"tcp://*:{port}") -# while True: -# dealer, __, *frames = await router_socket.recv_multipart() -# for frame in frames: -# handler(dealer.decode("utf-8"), frame) -# if set_when_done: -# return - -# loop.run_until_complete(_run_server()) -# loop.close() - @pytest.fixture def snapshot():