Skip to content

test(server): expect Python's key collision in the tojson coercion test - #3115

Merged
inureyes merged 1 commit into
mainfrom
fix/chat-template-json-key-test
Nov 16, 2026
Merged

inureyes merged 1 commit into
mainfrom
fix/chat-template-json-key-test

Conversation

@inureyes

Copy link
Copy Markdown
Member

server::chat_template_json::tests::non_string_object_keys_are_coerced_like_python fails on main after #2819.

minijinja's Value now compares true equal to 1, as Python does, so a map with both keys keeps one entry. The test expected {"1": "a", "true": "b"}, but the code now produces {"1": "b"}, which is exactly json.dumps({1: "a", True: "b"}). The code is right and the test's expectation was wrong.

The test now checks each coercion with its own map, and pins the collision case to Python's result. The chat_template_json tests pass (21).

After the dependency update in #2819, minijinja's Value compares true equal to 1, as Python does, so a map with both keys keeps one entry. server::chat_template_json::tests::non_string_object_keys_are_coerced_like_python then failed on main: it expected {"1": "a", "true": "b"} and got {"1": "b"}, which is exactly json.dumps({1: "a", True: "b"}). The test now checks each coercion with its own map and pins the collision to Python's result. The chat_template_json tests pass (21).
@inureyes inureyes added status:review Under review type:test Test related changes priority:high High priority labels Nov 16, 2026
@inureyes
inureyes merged commit aa07e05 into main Nov 16, 2026
32 checks passed
@inureyes
inureyes deleted the fix/chat-template-json-key-test branch November 16, 2026 06:03
@inureyes inureyes added this to the 0.9 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:high High priority status:review Under review type:test Test related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant