From e5b0ac30aa54c06664f9d61840c4b9aa9581c500 Mon Sep 17 00:00:00 2001 From: Alexsander Hamir Date: Tue, 27 Jan 2026 12:19:24 -0800 Subject: [PATCH] fix(test): reload auth_checks module in CLI JWT expiration test The test was reloading the constants module but not auth_checks, which imports CLI_JWT_EXPIRATION_HOURS at module level. This caused the test to use the old cached value instead of the new environment variable value. --- tests/test_litellm/proxy/auth/test_auth_checks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/proxy/auth/test_auth_checks.py b/tests/test_litellm/proxy/auth/test_auth_checks.py index 3df0dc881e8..c4c3f2c784f 100644 --- a/tests/test_litellm/proxy/auth/test_auth_checks.py +++ b/tests/test_litellm/proxy/auth/test_auth_checks.py @@ -166,9 +166,12 @@ def test_get_cli_jwt_auth_token_custom_expiration( import importlib from litellm import constants + from litellm.proxy.auth import auth_checks importlib.reload(constants) + # Also reload auth_checks to pick up the new constant value + importlib.reload(auth_checks) - token = ExperimentalUIJWTToken.get_cli_jwt_auth_token(valid_sso_user_defined_values) + token = auth_checks.ExperimentalUIJWTToken.get_cli_jwt_auth_token(valid_sso_user_defined_values) # Decrypt and verify token contents decrypted_token = decrypt_value_helper(