File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 88from unittest .mock import AsyncMock , MagicMock , patch
99import pytest
1010
11- sys .modules ["azure.monitor.events.extension" ] = MagicMock ()
11+ # Project-specific imports
12+ from autogen_core .base import AgentInstantiationContext , AgentRuntime
13+ from src .backend .agents .human import HumanAgent
14+ from src .backend .models .messages import HumanFeedback , Step , StepStatus , BAgentType
1215
13- # Environment and Mock setup (must be before imports)
16+ # Set environment variables before any imports to avoid runtime errors
1417os .environ ["COSMOSDB_ENDPOINT" ] = "https://mock-endpoint"
1518os .environ ["COSMOSDB_KEY" ] = "mock-key"
1619os .environ ["COSMOSDB_DATABASE" ] = "mock-database"
2023os .environ ["AZURE_OPENAI_API_VERSION" ] = "2023-01-01"
2124os .environ ["AZURE_OPENAI_ENDPOINT" ] = "https://mock-openai-endpoint"
2225
23-
24- from autogen_core .base import AgentInstantiationContext , AgentRuntime
25- from src .backend .agents .human import HumanAgent
26- from src .backend .models .messages import (
27- HumanFeedback ,
28- Step ,
29- StepStatus ,
30- BAgentType ,
31- )
26+ # Mock Azure modules
27+ sys .modules ["azure.monitor.events.extension" ] = MagicMock ()
3228
3329
3430@pytest .fixture
You can’t perform that action at this time.
0 commit comments