Skip to content

Commit 91bf8ea

Browse files
authored
test: guard typed rate-limit retry test with importorskip("anthropic") (#113) (#114)
test_invoke_llm_with_retry_on_typed_rate_limit did a bare `import anthropic`, so it failed with ModuleNotFoundError instead of skipping when the anthropic extra isn't installed (e.g. `uv sync --extra openai` only). Mirrors the existing pytest.importorskip("botocore") pattern used for Bedrock tests in tests/test_llm.py (v0.6.1, M2).
1 parent 6e52c0d commit 91bf8ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/test_agents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def test_invoke_llm_with_retry_raises_after_max_attempts(self) -> None:
277277

278278
def test_invoke_llm_with_retry_on_typed_rate_limit(self) -> None:
279279
"""Typed SDK RateLimitError retries without '429' in the message."""
280-
import anthropic
280+
anthropic = pytest.importorskip("anthropic")
281281

282282
mock_llm = MagicMock()
283283
mock_llm.bind_tools.return_value = mock_llm

0 commit comments

Comments
 (0)