Skip to content

Commit bab7567

Browse files
fix tests
1 parent 51a07ff commit bab7567

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

tests/tracing/test_decorator.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ async def _some_function_traced(a, b, c):
122122

123123

124124
def test_span_templates_ai_dicts(sentry_init, capture_items):
125-
sentry_init(traces_sample_rate=1.0)
125+
sentry_init(
126+
traces_sample_rate=1.0,
127+
_experiments={"gen_ai_as_v2_spans": True},
128+
)
126129
items = capture_items("span")
127130

128131
@sentry_sdk.trace(template=SPANTEMPLATE.AI_TOOL)
@@ -241,7 +244,10 @@ def my_agent():
241244

242245

243246
def test_span_templates_ai_objects(sentry_init, capture_items):
244-
sentry_init(traces_sample_rate=1.0)
247+
sentry_init(
248+
traces_sample_rate=1.0,
249+
_experiments={"gen_ai_as_v2_spans": True},
250+
)
245251
items = capture_items("span")
246252

247253
@sentry_sdk.trace(template=SPANTEMPLATE.AI_TOOL)
@@ -365,7 +371,11 @@ def my_agent():
365371

366372
@pytest.mark.parametrize("send_default_pii", [True, False])
367373
def test_span_templates_ai_pii(sentry_init, capture_items, send_default_pii):
368-
sentry_init(traces_sample_rate=1.0, send_default_pii=send_default_pii)
374+
sentry_init(
375+
traces_sample_rate=1.0,
376+
send_default_pii=send_default_pii,
377+
_experiments={"gen_ai_as_v2_spans": True},
378+
)
369379
items = capture_items("span")
370380

371381
@sentry_sdk.trace(template=SPANTEMPLATE.AI_TOOL)

tests/tracing/test_misc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,10 @@ def test_conversation_id_propagates_to_span_with_gen_ai_op(
650650
self, sentry_init, capture_items
651651
):
652652
"""Span with gen_ai.* op should get conversation_id."""
653-
sentry_init(traces_sample_rate=1.0)
653+
sentry_init(
654+
traces_sample_rate=1.0,
655+
_experiments={"gen_ai_as_v2_spans": True},
656+
)
654657
items = capture_items("span")
655658

656659
scope = sentry_sdk.get_current_scope()

0 commit comments

Comments
 (0)