From acd925cf2a5812f7d2f5662e9a597f37003ac91a Mon Sep 17 00:00:00 2001 From: Bruno Domingues Date: Tue, 4 Aug 2026 12:01:06 -0300 Subject: [PATCH] refactor(opc): Rename async close method to aclose Renamed the OPC.close asynchronous method to OPC.aclose to align with common Python conventions for asynchronous context managers and methods, improving clarity. All call sites and tests have been updated accordingly. --- laborious/activities/activities.py | 2 +- laborious/activities/opc.py | 2 +- tests/laborious/activities/test_opc.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/laborious/activities/activities.py b/laborious/activities/activities.py index 9a03f54..df78a08 100644 --- a/laborious/activities/activities.py +++ b/laborious/activities/activities.py @@ -164,6 +164,6 @@ class Activities(Storage, MLFlow, Gates, OPC, ModelMetrics, API): Storage.close(self) MLFlow.close(self) Gates.close(self) - await OPC.close(self) + await OPC.aclose(self) ModelMetrics.close(self) API.close(self) diff --git a/laborious/activities/opc.py b/laborious/activities/opc.py index be5a941..04ed18e 100644 --- a/laborious/activities/opc.py +++ b/laborious/activities/opc.py @@ -491,7 +491,7 @@ class OPC(SientiaMonitoring): return data.to_dict() - async def close(self): + async def aclose(self): """ Gracefully shutdown all OPC server connections and cleanup resources. diff --git a/tests/laborious/activities/test_opc.py b/tests/laborious/activities/test_opc.py index c2d37dd..6a36f8a 100644 --- a/tests/laborious/activities/test_opc.py +++ b/tests/laborious/activities/test_opc.py @@ -734,5 +734,5 @@ async def test_validate_server(opc): @mark.asyncio async def test_close(opc): opc.opc_repository['server1'].disconnect = AsyncMock(return_value=True) - await opc.close() + await opc.aclose() opc.opc_repository['server1'].disconnect.assert_called_once()