Files
litellm/tests/test_litellm/integrations
Julio Quinteros ProandClaude Sonnet 4.6 32922449a3 fix: restore sys.modules after stub injection in langfuse otel test
test_extract_langfuse_metadata_with_header_enrichment replaced
sys.modules["litellm.integrations.langfuse.langfuse"] with a stub
module but never restored it. This caused subsequent tests using
patch("litellm.integrations.langfuse.langfuse._add_prompt_to_generation_params")
to patch the stub instead of the real module, while _log_langfuse_v2
executed from the real module's globals (unpatched), triggering
ModuleNotFoundError and assertion failures.

Fix: use monkeypatch.setitem() so pytest automatically restores the
original module after the test completes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-17 22:01:21 -03:00
..
2026-01-09 11:23:47 +09:00
2026-01-09 11:23:47 +09:00
2026-01-07 21:03:22 +05:30
2026-01-07 18:17:22 +05:30