Skip to content

Commit d29ddb8

Browse files
committed
fix test
1 parent df7b0d8 commit d29ddb8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/integrations/litellm/test_litellm.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,15 @@ def test_litellm_specific_parameters(sentry_init, capture_events):
566566
assert span["data"]["gen_ai.litellm.custom_llm_provider"] == "custom_provider"
567567

568568

569-
def test_no_integration(sentry_init, capture_events):
569+
def test_no_integration(
570+
sentry_init, capture_events, reset_integrations, uninstall_integration
571+
):
570572
"""Test that when integration is not enabled, callbacks don't break."""
573+
# Reset integrations since LiteLLM is now auto-enabled and we need to test
574+
# the behavior when it's explicitly disabled
571575
sentry_init(
572576
traces_sample_rate=1.0,
577+
disabled_integrations=[LiteLLMIntegration],
573578
)
574579
events = capture_events()
575580

@@ -597,6 +602,9 @@ def test_no_integration(sentry_init, capture_events):
597602
assert event["type"] == "transaction"
598603
assert len(event.get("spans", [])) == 0
599604

605+
# Clean up: uninstall litellm so subsequent tests can re-install it
606+
uninstall_integration("litellm")
607+
600608

601609
def test_response_without_usage(sentry_init, capture_events):
602610
"""Test handling of responses without usage information."""

0 commit comments

Comments
 (0)