mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
test(bedrock): justify the litellm-internal patch for CI's test-quality gate
The test-quality budget (TQ008) flags any patch() targeting a litellm. internal, since that idiom usually pins wiring instead of behavior. Here the point of the test is exactly which invoke_provider the decoder factory receives, so the patch is unavoidable; annotate it.
This commit is contained in:
parent
6abbb79935
commit
1227ab8366
1 changed files with 3 additions and 1 deletions
|
|
@ -523,7 +523,9 @@ def test_handle_logging_collected_chunks_inference_profile_arn_falls_back_gracef
|
|||
|
||||
# Intercept the decoder so we don't need real botocore event-stream bytes.
|
||||
# The import is done inside handle_logging_collected_chunks, so patch the source module.
|
||||
with patch("litellm.llms.bedrock.chat.get_bedrock_event_stream_decoder") as mock_decoder:
|
||||
with patch( # test-quality-ok: the behavior under test is which invoke_provider this factory receives
|
||||
"litellm.llms.bedrock.chat.get_bedrock_event_stream_decoder"
|
||||
) as mock_decoder:
|
||||
mock_chunk_obj = MagicMock()
|
||||
mock_chunk_obj._chunk_parser.return_value = {} # not a valid GenericStreamingChunk
|
||||
mock_decoder.return_value = mock_chunk_obj
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue