From ff4e80ca656aa4604d5ba4f80411aa15648cfcbe Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:15:33 -0800 Subject: [PATCH] test(anthropic): keep the header merge regression test clear of main's appended tests --- .../anthropic/test_anthropic_common_utils.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/unit/llms/anthropic/test_anthropic_common_utils.py b/tests/unit/llms/anthropic/test_anthropic_common_utils.py index aa0aebaa9c9..3feb730b2e1 100644 --- a/tests/unit/llms/anthropic/test_anthropic_common_utils.py +++ b/tests/unit/llms/anthropic/test_anthropic_common_utils.py @@ -4692,6 +4692,18 @@ def test_requires_native_compaction_beta_is_false_without_a_signal( assert requires_native_compaction_beta(provider, optional_params, messages) is False +def test_merge_header_sources_keeps_only_the_string_betas_of_a_mixed_list() -> None: + merged: Final = merge_header_sources( + {"anthropic-beta": ["context-1m-2025-08-07", b"bytes-beta", ("nested",), object(), 3]}, + {"Anthropic-Beta": "message-threads-2026-08-12", "x-other": "kept"}, + ) + + assert dict(merged) == { + "anthropic-beta": "context-1m-2025-08-07,message-threads-2026-08-12", + "x-other": "kept", + } + + @pytest.mark.parametrize( ("custom_llm_provider", "model", "expected"), [ @@ -4733,15 +4745,3 @@ def test_tools_without_strict_drops_only_the_strict_key_and_counts_the_strict_to assert tools_without_strict(tools) == ToolsWithoutStrict( tools=({"name": "a"}, {"name": "b"}, {"name": "c"}), dropped_count=1 ) - - -def test_merge_header_sources_keeps_only_the_string_betas_of_a_mixed_list() -> None: - merged: Final = merge_header_sources( - {"anthropic-beta": ["context-1m-2025-08-07", b"bytes-beta", ("nested",), object(), 3]}, - {"Anthropic-Beta": "message-threads-2026-08-12", "x-other": "kept"}, - ) - - assert dict(merged) == { - "anthropic-beta": "context-1m-2025-08-07,message-threads-2026-08-12", - "x-other": "kept", - }