Skip to content

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]

use_callback_in_llm_call

Ishaan Jafferddf918cb42d0
diff --git a/tests/logging_callback_tests/test_unit_tests_init_callbacks.py b/tests/logging_callback_tests/test_unit_tests_init_callbacks.py
index a0ba4f34d94..0226fd66fdf 100644
--- a/tests/logging_callback_tests/test_unit_tests_init_callbacks.py
+++ b/tests/logging_callback_tests/test_unit_tests_init_callbacks.py
@@ -102,6 +102,26 @@ async def use_callback_in_llm_call(
elif callback == "openmeter":
# it's currently handled in jank way, TODO: fix openmete and then actually run it's test
return
+ elif callback == "bitbucket":
+ # Set up mock bitbucket configuration required for initialization
+ litellm.global_bitbucket_config = {
+ "workspace": "test-workspace",
+ "repository": "test-repo",
+ "access_token": "test-token",
+ "branch": "main"
+ }
+ # Mock BitBucket HTTP calls to prevent actual API requests
+ import httpx
+ from unittest.mock import MagicMock
+
+ mock_response = MagicMock()
+ mock_response.status_code = 200
+ mock_response.json.return_value = {"values": []}
+ mock_response.text = ""
+
+ patch.object(
+ litellm.module_level_client, "get", return_value=mock_response
+ ).start()
elif callback == "prometheus":
# pytest teardown - clear existing prometheus collectors
collectors = list(REGISTRY._collector_to_names.keys())
@@ -175,7 +195,10 @@ async def use_callback_in_llm_call(
if callback == "argilla":
patch.stopall()
- if callback == "argilla":
+ if callback == "bitbucket":
+ # Clean up bitbucket configuration and patches
+ if hasattr(litellm, 'global_bitbucket_config'):
+ delattr(litellm, 'global_bitbucket_config')
patch.stopall()