From 217d3f38de7d8f02f43970304df4e0909bcd10ff Mon Sep 17 00:00:00 2001 From: Yassin Kortam Date: Sat, 22 Aug 2026 11:56:49 -0700 Subject: [PATCH] test(cli-sessions): drop the cwd-relative sys.path.insert hacks The two new CLI-session test files were added before #37802 swept the suite's sys.path.insert(0, os.path.abspath(...)) calls, so rebasing onto staging put them over the TQ003 test-quality-budget ceiling and failed lint. --- .../test_litellm/proxy/auth/test_cli_session_registry.py | 8 +------- .../management_endpoints/test_cli_session_endpoints.py | 8 +++----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tests/test_litellm/proxy/auth/test_cli_session_registry.py b/tests/test_litellm/proxy/auth/test_cli_session_registry.py index 367fe1124be..844fd0cdbde 100644 --- a/tests/test_litellm/proxy/auth/test_cli_session_registry.py +++ b/tests/test_litellm/proxy/auth/test_cli_session_registry.py @@ -1,14 +1,10 @@ import json -import os -import sys import time from datetime import datetime, timedelta, timezone import pytest from prisma.engine.errors import EngineConnectionError -sys.path.insert(0, os.path.abspath("../..")) - from litellm.caching.dual_cache import DualCache from litellm.caching.in_memory_cache import InMemoryCache from litellm.constants import DEFAULT_IN_MEMORY_TTL @@ -316,9 +312,7 @@ async def test_db_outage_follows_the_proxy_wide_posture(monkeypatch): monkeypatch.setattr(proxy_server, "general_settings", {"allow_requests_on_db_unavailable": True}, raising=False) assert ( - await is_cli_session_revoked( - session_token=SESSION_TOKEN, prisma_client=prisma, user_api_key_cache=_cache() - ) + await is_cli_session_revoked(session_token=SESSION_TOKEN, prisma_client=prisma, user_api_key_cache=_cache()) is False ) diff --git a/tests/test_litellm/proxy/management_endpoints/test_cli_session_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_cli_session_endpoints.py index 5d4813c4eb4..9e972abd2bf 100644 --- a/tests/test_litellm/proxy/management_endpoints/test_cli_session_endpoints.py +++ b/tests/test_litellm/proxy/management_endpoints/test_cli_session_endpoints.py @@ -1,13 +1,9 @@ -import os -import sys from datetime import datetime, timedelta, timezone from unittest.mock import patch import pytest from fastapi import HTTPException -sys.path.insert(0, os.path.abspath("../../../")) - from litellm.caching.dual_cache import DualCache from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuth from litellm.proxy.management_endpoints.cli_session_endpoints import ( @@ -109,6 +105,8 @@ async def test_revoking_an_unknown_session_is_a_404(): with prisma_patch, cache_patch: with pytest.raises(HTTPException) as exc_info: - await revoke_cli_session_endpoint(session_id="nope", user_api_key_dict=_caller(LitellmUserRoles.PROXY_ADMIN)) + await revoke_cli_session_endpoint( + session_id="nope", user_api_key_dict=_caller(LitellmUserRoles.PROXY_ADMIN) + ) assert exc_info.value.status_code == 404