The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fix: mock test tests
Sameer Kankute8c454eb74f07
diff --git a/tests/test_litellm/proxy/guardrails/test_pillar_guardrails.py b/tests/test_litellm/proxy/guardrails/test_pillar_guardrails.pyindex 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 importsimport osimport sys-from typing import Dict+from typing import Dict, Anyfrom 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# ============================================================================[email protected](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.fixturedef env_setup(monkeypatch):"""Fixture to set up environment variables for testing."""