From 74130cbbb5a8b112e8d387c77edf62d837573ce5 Mon Sep 17 00:00:00 2001 From: Kanchan-Microsoft Date: Wed, 29 Apr 2026 12:13:19 +0530 Subject: [PATCH 1/2] fix code quality issues --- .../src/services/content_process_service.py | 2 +- src/ContentProcessorWorkflow/src/utils/http_request.py | 2 +- src/tests/ContentProcessorAPI/libs/test_cosmos_db_helper.py | 2 +- src/tests/ContentProcessorWorkflow/conftest.py | 6 ------ .../libs/application/test_application_context_di.py | 2 +- .../ContentProcessorWorkflow/steps/test_rai_executor.py | 2 -- 6 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/ContentProcessorWorkflow/src/services/content_process_service.py b/src/ContentProcessorWorkflow/src/services/content_process_service.py index 4ddf49e0..2bf53131 100644 --- a/src/ContentProcessorWorkflow/src/services/content_process_service.py +++ b/src/ContentProcessorWorkflow/src/services/content_process_service.py @@ -297,7 +297,7 @@ async def poll_status( if on_poll is not None: poll_handler = on_poll(result) if inspect.isawaitable(poll_handler): - await poll_handler + _ = await poll_handler status = result.get("status", "processing") if status in ("Completed", "Error"): diff --git a/src/ContentProcessorWorkflow/src/utils/http_request.py b/src/ContentProcessorWorkflow/src/utils/http_request.py index a6b3c0d0..fb43d1ea 100644 --- a/src/ContentProcessorWorkflow/src/utils/http_request.py +++ b/src/ContentProcessorWorkflow/src/utils/http_request.py @@ -635,7 +635,7 @@ async def poll_until_done( if on_poll is not None: maybe_awaitable = on_poll(resp) if inspect.isawaitable(maybe_awaitable): - await maybe_awaitable + _ = await maybe_awaitable if resp.status in done: return resp diff --git a/src/tests/ContentProcessorAPI/libs/test_cosmos_db_helper.py b/src/tests/ContentProcessorAPI/libs/test_cosmos_db_helper.py index d9b42955..46e7cc22 100644 --- a/src/tests/ContentProcessorAPI/libs/test_cosmos_db_helper.py +++ b/src/tests/ContentProcessorAPI/libs/test_cosmos_db_helper.py @@ -120,7 +120,7 @@ def test_count_documents(mock_certifi, mock_mongo_client): result = helper.count_documents({"key": "value"}) assert result == 42 - result = helper.count_documents() + helper.count_documents() mock_container.count_documents.assert_called_with({}) diff --git a/src/tests/ContentProcessorWorkflow/conftest.py b/src/tests/ContentProcessorWorkflow/conftest.py index c8d2e564..920a27e2 100644 --- a/src/tests/ContentProcessorWorkflow/conftest.py +++ b/src/tests/ContentProcessorWorkflow/conftest.py @@ -9,10 +9,4 @@ if str(workflow_src_path) not in sys.path: sys.path.insert(0, str(workflow_src_path)) -# Import sitecustomize if available -try: - import sitecustomize # noqa: F401 -except Exception: - pass - pytest_plugins = ["pytest_mock"] diff --git a/src/tests/ContentProcessorWorkflow/libs/application/test_application_context_di.py b/src/tests/ContentProcessorWorkflow/libs/application/test_application_context_di.py index d8668eb6..3241ef22 100644 --- a/src/tests/ContentProcessorWorkflow/libs/application/test_application_context_di.py +++ b/src/tests/ContentProcessorWorkflow/libs/application/test_application_context_di.py @@ -33,7 +33,7 @@ def test_caches_instance(self) -> None: assert a is b def test_with_factory(self) -> None: - ctx = AppContext().add_singleton(_S1, lambda: _S1()) + ctx = AppContext().add_singleton(_S1, _S1) a = ctx.get_service(_S1) b = ctx.get_service(_S1) assert a is b diff --git a/src/tests/ContentProcessorWorkflow/steps/test_rai_executor.py b/src/tests/ContentProcessorWorkflow/steps/test_rai_executor.py index 8b682195..48a267b8 100644 --- a/src/tests/ContentProcessorWorkflow/steps/test_rai_executor.py +++ b/src/tests/ContentProcessorWorkflow/steps/test_rai_executor.py @@ -22,8 +22,6 @@ # The @handler decorator in agent_framework validates type annotations at # import time, which fails in the test environment. Patch it to a no-op # before importing the executor module. -_orig_handler = sys.modules.get("agent_framework", MagicMock()).handler # type: ignore[union-attr] - with patch("agent_framework.handler", lambda fn: fn): from steps.rai.executor.rai_executor import RAIExecutor From 91cd706ba7ddc1a6495817cb5db1ec6f99f2f317 Mon Sep 17 00:00:00 2001 From: Kanchan-Microsoft Date: Wed, 29 Apr 2026 12:21:08 +0530 Subject: [PATCH 2/2] fixed pylint issue Co-authored-by: Copilot --- src/tests/ContentProcessorWorkflow/steps/test_rai_executor.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tests/ContentProcessorWorkflow/steps/test_rai_executor.py b/src/tests/ContentProcessorWorkflow/steps/test_rai_executor.py index 48a267b8..6169a3d9 100644 --- a/src/tests/ContentProcessorWorkflow/steps/test_rai_executor.py +++ b/src/tests/ContentProcessorWorkflow/steps/test_rai_executor.py @@ -11,7 +11,6 @@ from __future__ import annotations import asyncio -import sys from pathlib import Path from unittest.mock import AsyncMock, MagicMock, patch