Skip to content

Commit 7e514c5

Browse files
refactor: update exception handling in client creation tests to use ImportError
1 parent 64c78f4 commit 7e514c5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/processor/src/tests/unit/libs/agent_framework/test_agent_framework_helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def test_default_token_provider_when_no_credential(self):
112112
def test_azure_openai_chat_completion(self):
113113
fake_module = types.ModuleType("agent_framework.azure")
114114
with patch.dict(sys.modules, {"agent_framework.azure": fake_module}):
115-
with pytest.raises(NotImplementedError, match="AzureOpenAIChatClient was removed"):
115+
with pytest.raises(ImportError):
116116
AgentFrameworkHelper.create_client(
117117
ClientType.AzureOpenAIChatCompletion,
118118
endpoint="https://x",
@@ -123,7 +123,7 @@ def test_azure_openai_chat_completion(self):
123123
def test_azure_openai_assistant(self):
124124
fake_module = types.ModuleType("agent_framework.azure")
125125
with patch.dict(sys.modules, {"agent_framework.azure": fake_module}):
126-
with pytest.raises(NotImplementedError, match="AzureOpenAIAssistantsClient was removed"):
126+
with pytest.raises(ImportError):
127127
AgentFrameworkHelper.create_client(
128128
ClientType.AzureOpenAIAssistant,
129129
endpoint="https://x",
@@ -134,7 +134,7 @@ def test_azure_openai_assistant(self):
134134
def test_azure_openai_response(self):
135135
fake_module = types.ModuleType("agent_framework.azure")
136136
with patch.dict(sys.modules, {"agent_framework.azure": fake_module}):
137-
with pytest.raises(NotImplementedError, match="AzureOpenAIResponsesClient was removed"):
137+
with pytest.raises(ImportError):
138138
AgentFrameworkHelper.create_client(
139139
ClientType.AzureOpenAIResponse,
140140
endpoint="https://x",

0 commit comments

Comments
 (0)