From 8c454eb74f07d965db8a75207de283ea224ce558 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 15 Jan 2026 22:02:51 +0530 Subject: [PATCH] Fix: mock test tests --- .../guardrails/test_pillar_guardrails.py | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/tests/test_litellm/proxy/guardrails/test_pillar_guardrails.py b/tests/test_litellm/proxy/guardrails/test_pillar_guardrails.py index d322e7ea7b1..681caf9716d 100644 --- a/tests/test_litellm/proxy/guardrails/test_pillar_guardrails.py +++ b/tests/test_litellm/proxy/guardrails/test_pillar_guardrails.py @@ -8,7 +8,7 @@ and following LiteLLM testing patterns and best practices. # Standard library imports import os import sys -from typing import Dict +from typing import Dict, Any from unittest.mock import Mock, patch # Add parent directory to path for imports @@ -43,35 +43,6 @@ from litellm.proxy.guardrails.init_guardrails import init_guardrails_v2 # ============================================================================ -@pytest.fixture(scope="function", autouse=True) -def setup_and_teardown(): - """ - Standard LiteLLM fixture that reloads litellm before every function - to speed up testing by removing callbacks being chained. - """ - import asyncio - import sys - - # Only reload if litellm is already in sys.modules - if "litellm" in sys.modules: - import importlib - importlib.reload(litellm) - - # Set up async loop - loop = asyncio.get_event_loop_policy().new_event_loop() - asyncio.set_event_loop(loop) - - # Set up litellm state - litellm.set_verbose = True - litellm.guardrail_name_config_map = {} - - yield - - # Teardown - loop.close() - asyncio.set_event_loop(None) - - @pytest.fixture def env_setup(monkeypatch): """Fixture to set up environment variables for testing."""