mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-18 08:25:10 +00:00
[Fix] WatsonX tests failing on CI due to missing env vars
Tests are fully mocked but require WATSONX_URL and WATSONX_PROJECT_ID to pass provider validation before reaching the mocked HTTP client. Add an autouse fixture with dummy values and clear WATSONX_ZENAPIKEY/ WATSONX_TOKEN to prevent env leakage from dotenv. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
40d4e79a00
commit
123052ecf8
@@ -13,6 +13,16 @@ import pytest
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def watsonx_env_vars(monkeypatch):
|
||||
"""Set required WatsonX env vars so the provider passes validation.
|
||||
Also clear WATSONX_ZENAPIKEY/WATSONX_TOKEN so they don't bypass the IAM token mock."""
|
||||
monkeypatch.setenv("WATSONX_URL", "https://us-south.ml.cloud.ibm.com")
|
||||
monkeypatch.setenv("WATSONX_PROJECT_ID", "test-project-id")
|
||||
monkeypatch.delenv("WATSONX_ZENAPIKEY", raising=False)
|
||||
monkeypatch.delenv("WATSONX_TOKEN", raising=False)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def watsonx_chat_completion_call():
|
||||
def _call(
|
||||
|
||||
Reference in New Issue
Block a user