litellm/tests/test_litellm/proxy/management_endpoints
Julio Quinteros Pro f542f92026 fix(tests): restore default_internal_user_params instead of delattr-ing it
Four finally blocks in test_internal_user_endpoints.py and one in
test_ui_sso.py used the pattern:

    if original_default_params is not None:
        litellm.default_internal_user_params = original_default_params
    else:
        delattr(litellm, "default_internal_user_params")

Since the attribute is defined in litellm/__init__.py with a default of
None, `getattr(litellm, "default_internal_user_params", None)` returns
None. The else branch then calls delattr(), permanently removing the
attribute from the module for the rest of the process.

Subsequent tests in the same pytest-xdist worker (e.g.
test_add_new_member_* in test_management_helpers_utils.py) then fail
with: AttributeError: module 'litellm' has no attribute
'default_internal_user_params'

Fix: replace all five flawed finally blocks with a simple assignment:
    litellm.default_internal_user_params = original_default_params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 13:33:53 -03:00
..
scim feat: add base /scim/v2 endpoint for SCIM resource discovery (#20301) 2026-02-02 14:27:00 -08:00
search_endpoints masking sensitive values 2026-02-03 16:09:37 -08:00
test_access_group_endpoints.py cache adjustment for deleted teams and keys 2026-02-14 09:28:02 -08:00
test_access_group_management.py [Feat] Model Management API - Add API Endpoint for creating model access group (#16663) 2025-11-14 16:40:43 -08:00
test_budget_endpoints.py [Release - 02/10/2026] v1.81.10-nightly 2026-02-10 16:26:30 -08:00
test_cache_settings_endpoints.py [Feat] UI - Allow setting cache settings on UI (#16143) 2025-10-31 17:43:59 -07:00
test_callback_management_endpoints.py [Feat] AI Gateway Auth - Allow using JWTs for signing in with Proxy CLI (#16756) 2025-11-17 19:47:29 -08:00
test_common_daily_activity.py fix: preserve key alias and team_id after key regeneration, deletion 2026-02-07 17:08:01 -08:00
test_common_utils.py allow team and org admins to call invitation/new 2026-02-11 11:23:27 -08:00
test_compliance_endpoints.py Add compliance checker endpoints + UI panel (#21432) 2026-02-17 18:22:26 -08:00
test_cost_tracking_settings.py [Feat] UI - Allow setting Provider Discounts on UI (#15550) 2025-10-14 20:08:18 -07:00
test_customer_budget.py test(customer): add unit tests for customer budget update functionality 2025-07-30 17:01:18 +00:00
test_customer_endpoints.py Adding tests 2025-12-04 12:36:15 -08:00
test_delete_callbacks_endpoint.py test_delete_callbacks_in_db 2025-11-08 14:05:44 -08:00
test_entraid_app_roles.py fix: app_roles missing from jwt payload (#16448) 2025-11-12 12:07:04 -08:00
test_internal_user_endpoints.py fix(tests): restore default_internal_user_params instead of delattr-ing it 2026-02-18 13:33:53 -03:00
test_key_management_endpoints.py Merge branch 'main' into litellm_oss_staging_02_16_2026 2026-02-17 18:24:56 +05:30
test_mcp_management_endpoints.py MCP fixes 2026-02-11 18:07:24 -08:00
test_model_management_endpoints.py Fix: Make PATCH /model/{model_id}/update handle team_id consistently with POST /model/new (#15297) 2025-10-07 14:04:08 -07:00
test_organization_endpoints.py optional query params for org list 2026-01-10 14:44:28 -08:00
test_router_settings_endpoints.py New endpoint for router fields + react query 2026-01-09 16:49:22 -08:00
test_tag_management_endpoints.py Fix tag management to preserve encrypted fields in litellm_params (#17484) 2025-12-18 02:28:39 +05:30
test_team_endpoints.py modernize /team/available endpoint, migrate link to UI 2026-02-07 16:44:29 -08:00
test_ui_sso.py fix(tests): restore default_internal_user_params instead of delattr-ing it 2026-02-18 13:33:53 -03:00