From b6f46c1eaf7d54a6f5afefe3ac76ebc0709f98bb Mon Sep 17 00:00:00 2001 From: yucheng Date: Sun, 13 Sep 2026 01:03:27 +0000 Subject: [PATCH] test(proxy): register the GCS test logger so the healthy /key/health flush test passes without a license Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../management_endpoints/test_key_management_endpoints.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py index 7251dd77d5b..41419f5adba 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py +++ b/tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py @@ -18452,9 +18452,10 @@ async def _key_logging_status_after_gcs_flush(sent: int, failed: int) -> Logging caller: Final = UserAPIKeyAuth(api_key="sk-1", team_id="team-gcs", metadata={"logging": []}, team_metadata={}) with ( patch("litellm.proxy.proxy_server.proxy_config", _default_team_gcs_proxy_config("team-gcs")), # test-quality-ok: test_key_logging reads the module-level proxy config - patch( # test-quality-ok: the registered logger is a process-wide registry, not an injectable - "litellm.litellm_core_utils.litellm_logging.get_custom_logger_compatible_class", - return_value=_gcs_logger_whose_flush_reports(sent=sent, failed=failed), + patch("litellm.proxy.proxy_server.premium_user", True), # test-quality-ok: the mock completion's GCS success event is premium-gated + patch( # test-quality-ok: the mock completion and the flush both look the logger up in this process-wide registry + "litellm.litellm_core_utils.litellm_logging._in_memory_loggers", + [_gcs_logger_whose_flush_reports(sent=sent, failed=failed)], ), ): return await test_key_logging(user_api_key_dict=caller, request=request, logging_callbacks=("gcs_bucket",))