Files
litellm/tests
Julio Quinteros Pro 54c24a8d08 fix(test): resolve merge conflict and fix bedrock thinking test flakiness
This commit addresses two issues:

1. **Merge conflict resolution**: Resolved merge conflict in litellm/integrations/opentelemetry.py
   that was preventing imports from working. The conflict was in the OpenTelemetry SDK
   LogRecord import section.

2. **Test flakiness fix**: Fixed intermittent failures in test_bedrock_converse_budget_tokens_preserved
   by properly configuring mock objects to avoid unawaited coroutine warnings.

The test was failing in CI with "Expected 'post' to have been called once. Called 0 times."
The root cause was improper mock setup where AsyncMock was creating async child methods
(raise_for_status, json) that returned unawaited coroutines, causing unreliable behavior
across different Python versions and test environments.

**Changes:**
- Set raise_for_status() and json() as explicit MagicMock instances on the response
- Use AsyncMock explicitly for the post() method via patch.object's 'new' parameter
- This ensures response methods are synchronous while the HTTP call remains async

**Testing:**
- Test now passes consistently across 5 consecutive runs
- RuntimeWarnings about unawaited coroutines eliminated (18 warnings → 16 warnings)
- Request JSON verification shows budget_tokens correctly preserved

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 12:31:26 -03:00
..
2026-02-14 12:59:15 -08:00
2026-01-20 18:37:56 +05:30
2026-02-14 12:28:18 -08:00
2026-02-12 17:53:40 -08:00
2026-01-31 19:08:07 -08:00
2026-02-13 22:01:28 -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.