Skip to content

Commit ff6e18d

Browse files
Merge pull request #796 from microsoft/psl-codefix
fix: fixed new suggestions by copilot
2 parents b92a822 + f4d5ea7 commit ff6e18d

6 files changed

Lines changed: 7 additions & 13 deletions

File tree

src/tests/backend/auth/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import pytest
66
import sys
77
import os
8-
from unittest.mock import MagicMock, patch
98
import base64
109
import json
1110

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import asyncio
1717
import logging
1818
import importlib.util
19-
from unittest.mock import patch, MagicMock, AsyncMock, Mock
20-
from typing import Any, Dict, Optional, List, Union
21-
from dataclasses import dataclass
19+
from unittest.mock import patch, MagicMock
2220

2321
# Add the src directory to sys.path for proper import
2422
src_path = os.path.join(os.path.dirname(__file__), '..', '..', '..', '..')

src/tests/backend/v4/config/test_agent_registry.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
including registration, unregistration, cleanup, and monitoring functionality.
66
"""
77

8-
import asyncio
98
import logging
109
import os
1110
import sys

src/tests/backend/v4/config/test_settings.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import os
99
import sys
1010
import unittest
11-
from unittest import IsolatedAsyncioTestCase
1211
from unittest.mock import AsyncMock, Mock, patch
1312

1413
# Add the backend directory to the Python path
@@ -162,7 +161,7 @@ def test_ad_token_provider(self, mock_config):
162161
self.assertEqual(token, "test-token-123")
163162
mock_credential.get_token.assert_called_once_with(mock_config.AZURE_COGNITIVE_SERVICES)
164163

165-
class TestAzureConfigAsync(IsolatedAsyncioTestCase):
164+
class TestAzureConfigAsync(unittest.IsolatedAsyncioTestCase):
166165
"""Async test cases for AzureConfig class."""
167166

168167
@patch('backend.v4.config.settings.AzureOpenAIChatClient')
@@ -284,7 +283,7 @@ def test_overwrite_existing_team(self):
284283
self.assertEqual(config.get_current_team(user_id), team_config2)
285284

286285

287-
class TestOrchestrationConfig(IsolatedAsyncioTestCase):
286+
class TestOrchestrationConfig(unittest.IsolatedAsyncioTestCase):
288287
"""Test cases for OrchestrationConfig class."""
289288

290289
def test_orchestration_config_creation(self):
@@ -490,7 +489,7 @@ def test_cleanup_clarification(self):
490489
self.assertNotIn(request_id, config._clarification_events)
491490

492491

493-
class TestConnectionConfig(IsolatedAsyncioTestCase):
492+
class TestConnectionConfig(unittest.IsolatedAsyncioTestCase):
494493
"""Test cases for ConnectionConfig class."""
495494

496495
def test_connection_config_creation(self):

src/tests/backend/v4/magentic_agents/models/test_agent_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Unit tests for backend.v4.magentic_agents.models.agent_models module."""
22
import sys
3-
from unittest.mock import Mock, patch, MagicMock
3+
from unittest.mock import patch, MagicMock
44
import pytest
55

66

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import logging
88
import os
99
import sys
10+
import unittest
1011
from typing import Any, Optional
11-
from unittest import IsolatedAsyncioTestCase
1212
from unittest.mock import Mock, AsyncMock, patch
1313

1414
import pytest
@@ -225,7 +225,7 @@ def convert(plan_text, facts, team, task):
225225
messages = sys.modules['v4.models.messages']
226226

227227

228-
class TestHumanApprovalMagenticManager(IsolatedAsyncioTestCase):
228+
class TestHumanApprovalMagenticManager(unittest.IsolatedAsyncioTestCase):
229229
"""Test cases for HumanApprovalMagenticManager class."""
230230

231231
def setUp(self):
@@ -697,5 +697,4 @@ async def test_create_progress_ledger_websocket_error(self):
697697

698698

699699
if __name__ == '__main__':
700-
import unittest
701700
unittest.main()

0 commit comments

Comments
 (0)