test(unit): stop test modules from putting their own directory on sys.path (#43421)

test_ssl_verify_unit.py inserted tests/unit at the front of sys.path, so any later import of litellm_proxy_extras resolved to the tests/unit/litellm_proxy_extras test package. Whenever the CircleCI shard split collected that file before test_litellm_proxy_extras_logging.py, collection failed with ModuleNotFoundError. test_gemini_session_leak.py had the same insert for its own directory
This commit is contained in:
yuneng-jiang 2026-09-28 12:20:20 -07:00 • committed by GitHub
parent 2e5034016f
commit 37be82e45e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 9 deletions

View file

@ -11,13 +11,9 @@ Validates that:
import asyncio
import gc
import sys
from pathlib import Path
import pytest
# Add litellm to path
sys.path.insert(0, str(Path(__file__).parent))
async def test_aiohttp_handler_cleanup():
"""Test BaseLLMAIOHTTPHandler session cleanup via __del__"""

View file

@ -5,15 +5,10 @@ These tests verify that ssl_verify parameters are correctly propagated
through the call stack without requiring live API credentials.
"""
import sys
from pathlib import Path
from unittest.mock import Mock, patch
import pytest
# Add litellm to path
sys.path.insert(0, str(Path(__file__).parent))
import litellm.proxy.guardrails.guardrail_hooks.aim.aim as _aim_module
import litellm.proxy.guardrails.guardrail_hooks.cato_networks.cato_networks as _cato_networks_module
from litellm.llms.bedrock.base_aws_llm import BaseAWSLLM