Skip to content

Commit 07b8a22

Browse files
committed
Add some 'pragma: no cover's for errors
1 parent d81ea65 commit 07b8a22

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

pydantic_ai_slim/pydantic_ai/models/anthropic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def _get_builtin_tools(self, model_request_parameters: ModelRequestParameters) -
368368
)
369369
elif isinstance(tool, CodeExecutionTool): # pragma: no branch
370370
tools.append(BetaCodeExecutionTool20250522Param(name='code_execution', type='code_execution_20250522'))
371-
else: # pragma: no branch
371+
else: # pragma: no cover
372372
raise UserError(
373373
f'`{tool.__class__.__name__}` is not supported by `AnthropicModel`. If it should be, please file an issue.'
374374
)

pydantic_ai_slim/pydantic_ai/models/google.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def _get_tools(self, model_request_parameters: ModelRequestParameters) -> list[T
221221
tools.append(ToolDict(google_search=GoogleSearchDict()))
222222
elif isinstance(tool, CodeExecutionTool): # pragma: no branch
223223
tools.append(ToolDict(code_execution=ToolCodeExecutionDict()))
224-
else: # pragma: no branch
224+
else: # pragma: no cover
225225
raise UserError(
226226
f'`{tool.__class__.__name__}` is not supported by `GoogleModel`. If it should be, please file an issue.'
227227
)

pydantic_ai_slim/pydantic_ai/models/groq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def _get_builtin_tools(
318318
if isinstance(tool, WebSearchTool):
319319
if not GroqModelProfile.from_profile(self.profile).groq_always_has_web_search_builtin_tool:
320320
raise UserError('`WebSearchTool` is not supported by Groq') # pragma: no cover
321-
else: # pragma: no branch
321+
else:
322322
raise UserError(
323323
f'`{tool.__class__.__name__}` is not supported by `GroqModel`. If it should be, please file an issue.'
324324
)

pydantic_ai_slim/pydantic_ai/models/openai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ def _get_web_search_options(self, model_request_parameters: ModelRequestParamete
462462
),
463463
)
464464
return WebSearchOptions(search_context_size=tool.search_context_size)
465-
else: # pragma: no branch
465+
else:
466466
raise UserError(
467467
f'`{tool.__class__.__name__}` is not supported by `OpenAIModel`. If it should be, please file an issue.'
468468
)
@@ -878,7 +878,7 @@ def _get_builtin_tools(self, model_request_parameters: ModelRequestParameters) -
878878
elif isinstance(tool, CodeExecutionTool): # pragma: no branch
879879
tools.append({'type': 'code_interpreter', 'container': {'type': 'auto'}})
880880
else:
881-
raise UserError(
881+
raise UserError( # pragma: no cover
882882
f'`{tool.__class__.__name__}` is not supported by `OpenAIResponsesModel`. If it should be, please file an issue.'
883883
)
884884
return tools

0 commit comments

Comments
 (0)