mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-19 00:01:29 +00:00
fix(tests): reset module-level cache in stale alias bypass tests
Reset _ENABLE_TEAM_STALE_ALIAS_BYPASS to None in both test functions to ensure test isolation and prevent ordering-dependent failures Made-with: Cursor
This commit is contained in:
parent
e4819165e3
commit
e81224d322
1 changed files with 8 additions and 0 deletions
|
|
@ -2046,7 +2046,11 @@ def test_update_model_if_team_alias_exists(data, user_api_key_dict, expected_mod
|
|||
|
||||
def test_team_alias_stale_bypass_disabled_by_default(monkeypatch):
|
||||
monkeypatch.delenv("LITELLM_ENABLE_TEAM_STALE_ALIAS_BYPASS", raising=False)
|
||||
import litellm.proxy.litellm_pre_call_utils as pre_call_utils
|
||||
from litellm.proxy.litellm_pre_call_utils import _update_model_if_team_alias_exists
|
||||
|
||||
# Reset module-level cache to ensure test isolation
|
||||
pre_call_utils._ENABLE_TEAM_STALE_ALIAS_BYPASS = None
|
||||
|
||||
class _MockRouter:
|
||||
team_model_to_deployment_indices = {("team-1", "gpt-4o"): [0]}
|
||||
|
|
@ -2067,7 +2071,11 @@ def test_team_alias_stale_bypass_disabled_by_default(monkeypatch):
|
|||
|
||||
|
||||
def test_team_alias_stale_bypass_enabled_by_flag(monkeypatch):
|
||||
import litellm.proxy.litellm_pre_call_utils as pre_call_utils
|
||||
from litellm.proxy.litellm_pre_call_utils import _update_model_if_team_alias_exists
|
||||
|
||||
# Reset module-level cache to ensure test isolation
|
||||
pre_call_utils._ENABLE_TEAM_STALE_ALIAS_BYPASS = None
|
||||
|
||||
class _MockRouter:
|
||||
team_model_to_deployment_indices = {("team-1", "gpt-4o"): [0]}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue