Skip to content

Commit b5171b7

Browse files
sentrivanaclaude
andauthored
ref: Use top-level trace_lifecycle and ignore_spans options in tests (#6855)
## Summary - Replaced all `_experiments={"trace_lifecycle": ...}` with top-level `trace_lifecycle=...` across 77 test files - Replaced `_experiments={"ignore_spans": ...}` with top-level `ignore_spans=...` - Kept backwards-compat tests in `test_client.py` and `test_span_streaming.py` that specifically verify `_experiments` still works and that top-level takes precedence Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 17e0348 commit b5171b7

77 files changed

Lines changed: 684 additions & 682 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/integrations/aiohttp/test_aiohttp.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ async def test_tracing_span_streaming(
11451145
integrations=[AioHttpIntegration()],
11461146
traces_sample_rate=1.0,
11471147
send_default_pii=send_pii,
1148-
_experiments={"trace_lifecycle": "stream"},
1148+
trace_lifecycle="stream",
11491149
)
11501150

11511151
async def hello(request):
@@ -1215,7 +1215,7 @@ async def test_sensitive_header_scrubbing_span_streaming(
12151215
sentry_init(
12161216
integrations=[AioHttpIntegration()],
12171217
traces_sample_rate=1.0,
1218-
_experiments={"trace_lifecycle": "stream"},
1218+
trace_lifecycle="stream",
12191219
)
12201220

12211221
async def hello(request):
@@ -1262,7 +1262,7 @@ async def test_sensitive_header_passthrough_with_pii_span_streaming(
12621262
integrations=[AioHttpIntegration()],
12631263
traces_sample_rate=1.0,
12641264
send_default_pii=True,
1265-
_experiments={"trace_lifecycle": "stream"},
1265+
trace_lifecycle="stream",
12661266
)
12671267

12681268
async def hello(request):
@@ -1300,7 +1300,7 @@ async def test_url_query_attribute_span_streaming(
13001300
integrations=[AioHttpIntegration()],
13011301
traces_sample_rate=1.0,
13021302
send_default_pii=send_pii,
1303-
_experiments={"trace_lifecycle": "stream"},
1303+
trace_lifecycle="stream",
13041304
)
13051305

13061306
async def hello(request):
@@ -1357,7 +1357,7 @@ async def test_transaction_style_span_streaming(
13571357
sentry_init(
13581358
integrations=[AioHttpIntegration(transaction_style=transaction_style)],
13591359
traces_sample_rate=1.0,
1360-
_experiments={"trace_lifecycle": "stream"},
1360+
trace_lifecycle="stream",
13611361
)
13621362

13631363
async def hello(request):
@@ -1387,7 +1387,7 @@ async def test_server_error_span_streaming(sentry_init, aiohttp_client, capture_
13871387
sentry_init(
13881388
integrations=[AioHttpIntegration()],
13891389
traces_sample_rate=1.0,
1390-
_experiments={"trace_lifecycle": "stream"},
1390+
trace_lifecycle="stream",
13911391
)
13921392

13931393
async def hello(request):
@@ -1428,7 +1428,7 @@ async def test_http_exception_span_streaming(
14281428
sentry_init(
14291429
integrations=[AioHttpIntegration()],
14301430
traces_sample_rate=1.0,
1431-
_experiments={"trace_lifecycle": "stream"},
1431+
trace_lifecycle="stream",
14321432
)
14331433

14341434
async def hello(request):
@@ -1460,7 +1460,7 @@ async def test_http_exception_ok_status_not_overridden_span_streaming(
14601460
sentry_init(
14611461
integrations=[AioHttpIntegration()],
14621462
traces_sample_rate=1.0,
1463-
_experiments={"trace_lifecycle": "stream"},
1463+
trace_lifecycle="stream",
14641464
)
14651465

14661466
async def hello(request):
@@ -1494,7 +1494,7 @@ async def test_outgoing_client_span_span_streaming(
14941494
integrations=[AioHttpIntegration()],
14951495
traces_sample_rate=1.0,
14961496
send_default_pii=send_pii,
1497-
_experiments={"trace_lifecycle": "stream"},
1497+
trace_lifecycle="stream",
14981498
)
14991499

15001500
async def handler(request):
@@ -1555,7 +1555,7 @@ async def test_outgoing_trace_headers_span_streaming(
15551555
sentry_init(
15561556
integrations=[AioHttpIntegration()],
15571557
traces_sample_rate=1.0,
1558-
_experiments={"trace_lifecycle": "stream"},
1558+
trace_lifecycle="stream",
15591559
)
15601560

15611561
async def handler(request):
@@ -1589,7 +1589,7 @@ async def test_user_ip_address_on_all_spans(
15891589
integrations=[AioHttpIntegration()],
15901590
traces_sample_rate=1.0,
15911591
send_default_pii=send_default_pii,
1592-
_experiments={"trace_lifecycle": "stream"},
1592+
trace_lifecycle="stream",
15931593
)
15941594

15951595
async def hello(request):

0 commit comments

Comments
 (0)