Skip to content

Commit 0cb9394

Browse files
authored
Update test_agent_config.py
1 parent d14cbe9 commit 0cb9394

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/test_agent_config.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ def test_name_validation_critical_cases(self):
178178
"""Test name validation - the original issue that started this PR"""
179179
# This was the original failing case that caused JSON serialization errors
180180
with pytest.raises(TypeError, match="Agent name must be a string, got int"):
181-
Agent(name=1)
181+
Agent(name=1) # type: ignore
182182

183183
with pytest.raises(TypeError, match="Agent name must be a string, got NoneType"):
184-
Agent(name=None)
184+
Agent(name=None) # type: ignore
185185

186186
def test_tool_use_behavior_dict_validation(self):
187187
"""Test tool_use_behavior accepts StopAtTools dict - fixes existing test failures"""
@@ -190,7 +190,7 @@ def test_tool_use_behavior_dict_validation(self):
190190

191191
# Invalid cases that should fail
192192
with pytest.raises(TypeError, match="Agent tool_use_behavior must be"):
193-
Agent(name="test", tool_use_behavior=123)
193+
Agent(name="test", tool_use_behavior=123) # type: ignore
194194

195195
def test_hooks_validation_python39_compatibility(self):
196196
"""Test hooks validation works with Python 3.9 - fixes generic type issues"""
@@ -199,20 +199,20 @@ class MockHooks(AgentHooksBase):
199199
pass
200200

201201
# Valid case
202-
Agent(name="test", hooks=MockHooks())
202+
Agent(name="test", hooks=MockHooks()) # type: ignore
203203

204204
# Invalid case
205205
with pytest.raises(TypeError, match="Agent hooks must be an AgentHooks instance"):
206-
Agent(name="test", hooks="invalid")
206+
Agent(name="test", hooks="invalid") # type: ignore
207207

208208
def test_list_field_validation(self):
209209
"""Test critical list fields that commonly get wrong types"""
210210
# These are the most common mistakes users make
211211
with pytest.raises(TypeError, match="Agent tools must be a list"):
212-
Agent(name="test", tools="not_a_list")
212+
Agent(name="test", tools="not_a_list") # type: ignore
213213

214214
with pytest.raises(TypeError, match="Agent handoffs must be a list"):
215-
Agent(name="test", handoffs="not_a_list")
215+
Agent(name="test", handoffs="not_a_list") # type: ignore
216216

217217
def test_model_settings_validation(self):
218218
"""Test model_settings validation - prevents runtime errors"""
@@ -223,4 +223,4 @@ def test_model_settings_validation(self):
223223
with pytest.raises(
224224
TypeError, match="Agent model_settings must be a ModelSettings instance"
225225
):
226-
Agent(name="test", model_settings={})
226+
Agent(name="test", model_settings={}) # type: ignore

0 commit comments

Comments
 (0)