[Fix] Reset api_base/api_key in xdist conftest to prevent cross-test leakage

test_rerank.py sets litellm.api_base = "http://localhost:4000" which leaked
to all subsequent tests on the same xdist worker, causing connection failures
across every provider (Cohere, Azure, OpenAI, etc.).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yuneng-jiang
2026-03-15 23:55:44 -07:00
co-authored by Claude Opus 4.6
parent 5db6aef834
commit acfaea9d25
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -30,6 +30,9 @@ _SCALAR_DEFAULTS = {
"force_ipv4": getattr(litellm, "force_ipv4", False),
"drop_params": getattr(litellm, "drop_params", None),
"modify_params": getattr(litellm, "modify_params", False),
"api_base": getattr(litellm, "api_base", None),
"api_key": getattr(litellm, "api_key", None),
"cohere_key": getattr(litellm, "cohere_key", None),
}
+2
View File
@@ -43,6 +43,8 @@ _SCALAR_DEFAULTS = {
"force_ipv4": getattr(litellm, "force_ipv4", False),
"drop_params": getattr(litellm, "drop_params", None),
"modify_params": getattr(litellm, "modify_params", False),
"api_base": getattr(litellm, "api_base", None),
"api_key": getattr(litellm, "api_key", None),
}