test(xai): narrow raises match for missing api key

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
kerry 2026-09-19 01:00:53 +00:00
parent 4565bbee2f
commit 80b0ea6a2f

View file

@ -92,7 +92,7 @@ def test_validate_environment_sets_bearer_header():
def test_validate_environment_requires_key(monkeypatch):
monkeypatch.delenv("XAI_API_KEY", raising=False)
monkeypatch.setattr(litellm, "xai_key", None)
with pytest.raises(ValueError):
with pytest.raises(ValueError, match="xAI API key is required"):
CONFIG.validate_environment(
headers={},
model="grok-voice-transcribe-2.0",