Skip to content

Commit 3dc6901

Browse files
ronakrmclaude
andcommitted
Add pragma: no cover to test helper tool functions
These mock tool functions are never actually called during tests, so their return statements don't need coverage. Achieves 100% coverage for test_anthropic.py. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 78aa4a3 commit 3dc6901

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/models/test_anthropic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,11 @@ async def test_anthropic_cache_tools(allow_model_requests: None):
443443
)
444444

445445
@agent.tool_plain
446-
def tool_one() -> str:
446+
def tool_one() -> str: # pragma: no cover
447447
return 'one'
448448

449449
@agent.tool_plain
450-
def tool_two() -> str:
450+
def tool_two() -> str: # pragma: no cover
451451
return 'two'
452452

453453
await agent.run('test prompt')
@@ -520,7 +520,7 @@ async def test_anthropic_cache_tools_and_instructions(allow_model_requests: None
520520
)
521521

522522
@agent.tool_plain
523-
def my_tool(value: str) -> str:
523+
def my_tool(value: str) -> str: # pragma: no cover
524524
return f'Result: {value}'
525525

526526
await agent.run('test prompt')

0 commit comments

Comments
 (0)