Files
litellm/tests/test_litellm/proxy
Julio Quinteros ProandClaude Sonnet 4.6 30d4f344ae fix(tests): restore proxy_server module attrs in test_proxy_admin_expired_key_from_cache
The test was using setattr() to set module-level attributes (including
proxy_logging_obj = MagicMock()) on the real litellm.proxy.proxy_server
module, but the finally block only had `pass` — no cleanup.

This left proxy_logging_obj as a MagicMock in subsequent tests running
in the same pytest-xdist worker, causing TypeError when log_db_metrics
decorator called asyncio.create_task(proxy_logging_obj.service_logging_obj
.async_service_success_hook(...)) — a MagicMock is not a coroutine.

Fix: save original attribute values before the test and restore them in
the finally block to ensure test isolation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 09:33:11 -03:00
..
2026-02-13 22:01:28 -08:00
2026-02-12 17:54:32 -08:00