test(proxy): use frozen config in pass-through and debug report tests
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
mateo 2026-10-08 05:13:55 +00:00
parent c1e7281d29
commit 83717d6883
2 changed files with 5 additions and 3 deletions

View file

@ -10,7 +10,7 @@ from fastapi import FastAPI
from fastapi.testclient import TestClient
from litellm.proxy import proxy_server
from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuth
from litellm.proxy._types import LitellmUserRoles, ProxyRuntimeConfig, UserAPIKeyAuth
from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
from litellm.proxy.bug_report_config import build_proxy_bug_report
from litellm.proxy.common_utils.debug_utils import (
@ -104,7 +104,7 @@ HOSTILE_STRINGS = ("acme", "sk-live-secret", "hunter2", "10.0.0.7", "azure.com")
@pytest.fixture
def hostile_proxy_config(monkeypatch: pytest.MonkeyPatch) -> Iterator[None]:
previous_config = proxy_server.proxy_config.get_config_state()
proxy_server.proxy_config.update_config_state(config=HOSTILE_CONFIG)
proxy_server.proxy_config.update_config_state(config=ProxyRuntimeConfig.from_resolved(HOSTILE_CONFIG))
monkeypatch.setattr(proxy_server, "general_settings", dict(HOSTILE_GENERAL_SETTINGS))
yield
proxy_server.proxy_config.update_config_state(config=previous_config)

View file

@ -8178,7 +8178,9 @@ async def test_a_settings_write_keeps_the_config_file_pass_throughs(tmp_path, mo
config: Final = await proxy.proxy_config.get_config(config_file_path=proxy.config_path)
await proxy.proxy_config.save_config(
new_config={**config, "general_settings": {**config["general_settings"], "max_parallel_requests": 7}}
new_config=config.with_section(
"general_settings", {**config.general_settings, "max_parallel_requests": 7}
)
)
saved_general_settings: Final = yaml.safe_load(open(proxy.config_path))["general_settings"]