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> |
||
|---|---|---|
| .. | ||
| test_auth_checks.py | ||
| test_auth_exception_handler.py | ||
| test_auth_utils.py | ||
| test_cli_auth.py | ||
| test_handle_jwt.py | ||
| test_litellm_license.py | ||
| test_login_utils.py | ||
| test_mcp_ip_filtering.py | ||
| test_model_checks_fallbacks.py | ||
| test_model_checks.py | ||
| test_object_permission_loading.py | ||
| test_organization_budget_enforcement.py | ||
| test_route_checks.py | ||
| test_team_member_budget.py | ||
| test_user_api_key_auth.py | ||