Merge pull request #40643 from BerriAI/litellm_fix_optional_logging_assertions

test: respect optional logging payload fields
This commit is contained in:
yuneng-jiang 2026-09-10 18:27:51 -07:00 committed by GitHub
commit 41b0deb627
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -1076,7 +1076,7 @@ def test_standard_logging_payload(model, turn_off_message_logging):
)
)
keys_list = list(StandardLoggingPayload.__annotations__.keys())
keys_list = list(StandardLoggingPayload.__required_keys__)
for k in keys_list:
assert (
@ -1190,7 +1190,7 @@ def test_standard_logging_payload_audio(turn_off_message_logging, stream):
)
)
keys_list = list(StandardLoggingPayload.__annotations__.keys())
keys_list = list(StandardLoggingPayload.__required_keys__)
for k in keys_list:
assert (

View file

@ -270,7 +270,7 @@ async def test_datadog_logging_http_request():
message = json.loads(body[0]["message"])
print("logged message", json.dumps(message, indent=4))
expected_message_fields = StandardLoggingPayload.__annotations__.keys()
expected_message_fields = StandardLoggingPayload.__required_keys__
for field in expected_message_fields:
assert field in message, f"Field '{field}' is missing from the message"