From ddf918cb42d00992d5ce02a5523ae6bb52aa4e09 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Sat, 27 Sep 2025 11:55:41 -0700 Subject: [PATCH] use_callback_in_llm_call --- .../test_unit_tests_init_callbacks.py | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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 a0ba4f34d9..0226fd66fd 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()