Skip to content

Commit b92a822

Browse files
Merge pull request #794 from microsoft/psl-codefix
fix: fixed copilot suggestions
2 parents cf11055 + 09d8068 commit b92a822

6 files changed

Lines changed: 6 additions & 16 deletions

File tree

src/tests/backend/common/config/test_app_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ def test_production_environment_client_creation(self, mock_ai_client, mock_cosmo
619619
config = AppConfig()
620620

621621
# Test credential creation uses ManagedIdentityCredential in prod
622-
credential = config.get_azure_credential("test-client-id")
622+
config.get_azure_credential("test-client-id")
623623
mock_managed_credential.assert_called_with(client_id="test-client-id")
624624

625625
# Test Cosmos client creation

src/tests/backend/common/utils/test_otlp_tracing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def test_configure_oltp_tracing_call_sequence(
483483
mock_processor.return_value = mock_processor_instance
484484

485485
# Execute
486-
result = configure_oltp_tracing()
486+
configure_oltp_tracing()
487487

488488
# Verify call sequence using call order
489489
expected_calls = [

src/tests/backend/v4/common/services/test_team_service.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def test_init_with_memory_context(self):
219219

220220
def test_init_config_attributes(self):
221221
"""Test that configuration attributes are properly set."""
222-
service = TeamService()
222+
TeamService()
223223

224224
# Verify config calls were made
225225
assert mock_config.get_azure_credentials.called
@@ -922,8 +922,7 @@ async def test_validate_single_index_not_found(self):
922922
# Patch the SearchIndexClient directly on the service call
923923
with patch.object(mock_search_indexes, 'SearchIndexClient', return_value=mock_index_client):
924924
# Mock the exception handling by patching the exception in the team_service_module
925-
original_validate = service.validate_single_index
926-
925+
927926
async def mock_validate(index_name):
928927
try:
929928
mock_index_client.get_index(index_name)

src/tests/backend/v4/magentic_agents/test_foundry_agent.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,6 @@ async def test_close_with_azure_server_agent(self, mock_get_logger, mock_config,
934934
agent.project_client = mock_project_client
935935

936936
# Mock the close method by setting up the agent to avoid base class call
937-
original_close = agent.close
938937
agent.close = AsyncMock()
939938

940939
# Override close to simulate the actual behavior but avoid base class issues

src/tests/backend/v4/magentic_agents/test_proxy_agent.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,6 @@ def test_timeout_and_error_scenarios(self):
125125
"""Test timeout and error handling scenarios."""
126126
import asyncio
127127

128-
async def simulate_timeout_behavior():
129-
"""Simulate the timeout behavior from _wait_for_user_clarification."""
130-
timeout_duration = 30 # seconds
131-
try:
132-
# Simulate waiting for user response that times out
133-
await asyncio.wait_for(asyncio.sleep(100), timeout=timeout_duration)
134-
return "Got response"
135-
except asyncio.TimeoutError:
136-
return "TIMEOUT_OCCURRED"
137128

138129
# Test that timeout logic would work
139130
loop = asyncio.new_event_loop()
@@ -339,6 +330,7 @@ async def simulate_send_clarification_request(request, timeout=30):
339330
"data": request,
340331
"timestamp": "2024-01-01T00:00:00Z"
341332
}
333+
logging.debug("Simulated websocket message dispatch: %s", message)
342334

343335
# Simulate waiting for response with timeout
344336
try:

src/tests/backend/v4/orchestration/test_human_approval_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ async def test_create_progress_ledger_websocket_error(self):
687687

688688
# Execute - should handle the error gracefully but still raise it
689689
with self.assertRaises(Exception) as cm:
690-
ledger = await self.manager.create_progress_ledger(context)
690+
await self.manager.create_progress_ledger(context)
691691

692692
# Verify the exception message
693693
self.assertEqual(str(cm.exception), "WebSocket error")

0 commit comments

Comments
 (0)