Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(test): restore default_internal_user_params to None instead of delattr

Julio Quinteros Pro77d1f6932e5e
diff --git a/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py b/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py
index 09b78335054..c34ee0aff56 100644
--- a/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py
+++ b/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py
@@ -3682,12 +3682,10 @@ async def test_role_mappings_override_default_internal_user_params():
# The models will be applied when new_user processes the request
finally:
- # Restore original default_internal_user_params
- if original_default_params is not None:
- litellm.default_internal_user_params = original_default_params
- else:
- if hasattr(litellm, "default_internal_user_params"):
- delattr(litellm, "default_internal_user_params")
+ # Restore original default_internal_user_params (always assign, never delattr —
+ # deleting the attribute causes AttributeError in subsequent tests because
+ # litellm.__getattr__ has no handler for this name)
+ litellm.default_internal_user_params = original_default_params
class TestSSOReadinessEndpoint: