Remove no-op patch of track_llm_api_timing in test

The decorator is applied at class definition time, so patching the
module-level name at call time has no effect. The test works without it.
This commit is contained in:
Dan Volz 2026-03-30 21:21:41 -07:00
parent efffc9c663
commit cfa0a8c72b
No known key found for this signature in database

View file

@ -777,7 +777,7 @@ class TestSyncStreamSplitChunks:
def test_sync_stream_wrapper_splits_batched_chunks(self):
"""Verify get_sync_custom_stream_wrapper splits multi-event HTTP chunks."""
from unittest.mock import MagicMock, patch
from unittest.mock import MagicMock
config = OCIChatConfig()
@ -792,17 +792,16 @@ class TestSyncStreamSplitChunks:
mock_client = MagicMock()
mock_client.post.return_value = mock_response
with patch("litellm.llms.oci.chat.transformation.track_llm_api_timing", lambda: lambda f: f):
result = config.get_sync_custom_stream_wrapper(
model=TEST_MODEL_NAME,
custom_llm_provider="oci",
logging_obj=MagicMock(),
api_base="https://example.com/chat",
headers={},
data={"test": "data"},
messages=[],
client=mock_client,
)
result = config.get_sync_custom_stream_wrapper(
model=TEST_MODEL_NAME,
custom_llm_provider="oci",
logging_obj=MagicMock(),
api_base="https://example.com/chat",
headers={},
data={"test": "data"},
messages=[],
client=mock_client,
)
# Consume the stream wrapper's completion_stream to verify splitting
chunks = list(result.completion_stream)