Files
litellm/tests
BlueT - Matthew Lien - 練喆明andGitHub c0de6c5c6c [Fix] handle metadata=None in SDK path retry/error logic (utils.py) (#20873)
* [Fix] handle metadata=None in SDK path retry/error logic (utils.py)

Fixes #20871

Same class of bug as #9717 (fixed by #9764 for the proxy path).
The SDK path in utils.py has the same fragile pattern at 7 locations.

Replace `kwargs.get("metadata", {})` with `(kwargs.get("metadata") or {})`
to handle the case where metadata key exists with value None (e.g. from
Azure OpenAI streaming responses).

This is consistent with the existing correct pattern at line 602:
`metadata = kwargs.get("metadata") or {}`

Adds TestMetadataNoneHandling with 6 unit tests in test_utils.py.

* fix: remove duplicate PerplexityResponsesConfig key in lazy imports registry

Removes duplicate dictionary key added in commit be0ebb15 (PR #20860).
The entry at line 1042 is identical to the existing entry at line 906.
This causes ruff F601 lint failure on all PRs targeting main.
2026-02-10 22:03:33 -08:00
..
2026-01-20 18:37:56 +05:30
2026-01-31 19:08:07 -08:00
2026-01-22 10:50:23 -08:00
2026-01-22 15:21:44 -08:00
2026-02-05 09:40:21 +05:30

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.