@@ -186,9 +186,7 @@ async def test_capture_transaction(
186186 sentry_init (
187187 send_default_pii = should_send_pii ,
188188 traces_sample_rate = 1.0 ,
189- _experiments = {
190- "trace_lifecycle" : "stream" if span_streaming else "static" ,
191- },
189+ trace_lifecycle = "stream" if span_streaming else "static" ,
192190 )
193191 app = SentryAsgiMiddleware (asgi3_app )
194192
@@ -262,9 +260,7 @@ async def test_capture_transaction_with_error(
262260 sentry_init (
263261 send_default_pii = True ,
264262 traces_sample_rate = 1.0 ,
265- _experiments = {
266- "trace_lifecycle" : "stream" if span_streaming else "static" ,
267- },
263+ trace_lifecycle = "stream" if span_streaming else "static" ,
268264 )
269265
270266 app = SentryAsgiMiddleware (asgi3_app_with_error )
@@ -330,9 +326,7 @@ async def test_has_trace_if_performance_enabled(
330326):
331327 sentry_init (
332328 traces_sample_rate = 1.0 ,
333- _experiments = {
334- "trace_lifecycle" : "stream" if span_streaming else "static" ,
335- },
329+ trace_lifecycle = "stream" if span_streaming else "static" ,
336330 )
337331 app = SentryAsgiMiddleware (asgi3_app_with_error_and_msg )
338332
@@ -425,9 +419,7 @@ async def test_trace_from_headers_if_performance_enabled(
425419):
426420 sentry_init (
427421 traces_sample_rate = 1.0 ,
428- _experiments = {
429- "trace_lifecycle" : "stream" if span_streaming else "static" ,
430- },
422+ trace_lifecycle = "stream" if span_streaming else "static" ,
431423 )
432424 app = SentryAsgiMiddleware (asgi3_app_with_error_and_msg )
433425
@@ -526,9 +518,7 @@ async def test_websocket(
526518 sentry_init (
527519 send_default_pii = True ,
528520 traces_sample_rate = 1.0 ,
529- _experiments = {
530- "trace_lifecycle" : "stream" if span_streaming else "static" ,
531- },
521+ trace_lifecycle = "stream" if span_streaming else "static" ,
532522 )
533523
534524 asgi3_ws_app = SentryAsgiMiddleware (asgi3_ws_app )
@@ -655,9 +645,7 @@ async def test_transaction_style(
655645 sentry_init (
656646 send_default_pii = True ,
657647 traces_sample_rate = 1.0 ,
658- _experiments = {
659- "trace_lifecycle" : "stream" if span_streaming else "static" ,
660- },
648+ trace_lifecycle = "stream" if span_streaming else "static" ,
661649 )
662650 app = SentryAsgiMiddleware (asgi3_app , transaction_style = transaction_style )
663651
@@ -874,8 +862,8 @@ async def test_get_request_attributes_url_with_filtered_host(
874862 sentry_init (
875863 send_default_pii = True ,
876864 traces_sample_rate = 1.0 ,
865+ trace_lifecycle = "stream" ,
877866 _experiments = {
878- "trace_lifecycle" : "stream" ,
879867 "data_collection" : {
880868 "http_headers" : {"request" : {"mode" : "allowlist" , "terms" : []}}
881869 },
@@ -906,8 +894,8 @@ async def test_get_request_attributes_url_with_headers_off(
906894 sentry_init (
907895 send_default_pii = True ,
908896 traces_sample_rate = 1.0 ,
897+ trace_lifecycle = "stream" ,
909898 _experiments = {
910- "trace_lifecycle" : "stream" ,
911899 "data_collection" : {"http_headers" : {"request" : {"mode" : "off" }}},
912900 },
913901 )
@@ -1140,9 +1128,11 @@ async def test_get_request_attributes_query_data_collection(
11401128 expected_query ,
11411129 expected_url_full ,
11421130):
1143- kwargs = {k : v for k , v in init_kwargs .items () if k != "_experiments" }
1144- experiments = {"trace_lifecycle" : "stream" , ** init_kwargs .get ("_experiments" , {})}
1145- sentry_init (traces_sample_rate = 1.0 , _experiments = experiments , ** kwargs )
1131+ sentry_init (
1132+ traces_sample_rate = 1.0 ,
1133+ trace_lifecycle = "stream" ,
1134+ ** init_kwargs ,
1135+ )
11461136 app = SentryAsgiMiddleware (asgi3_app )
11471137
11481138 items = capture_items ("span" )
@@ -1242,9 +1232,11 @@ async def test_get_request_data_env_user_info(
12421232async def test_get_request_attributes_client_address_user_info (
12431233 sentry_init , capture_items , asgi3_app , init_kwargs , has_client , expect_ip
12441234):
1245- kwargs = {k : v for k , v in init_kwargs .items () if k != "_experiments" }
1246- experiments = {"trace_lifecycle" : "stream" , ** init_kwargs .get ("_experiments" , {})}
1247- sentry_init (traces_sample_rate = 1.0 , _experiments = experiments , ** kwargs )
1235+ sentry_init (
1236+ traces_sample_rate = 1.0 ,
1237+ trace_lifecycle = "stream" ,
1238+ ** init_kwargs ,
1239+ )
12481240 app = SentryAsgiMiddleware (asgi3_app )
12491241
12501242 scope = _http_scope ()
@@ -1304,9 +1296,7 @@ async def test_transaction_name(
13041296 """
13051297 sentry_init (
13061298 traces_sample_rate = 1.0 ,
1307- _experiments = {
1308- "trace_lifecycle" : "stream" if span_streaming else "static" ,
1309- },
1299+ trace_lifecycle = "stream" if span_streaming else "static" ,
13101300 )
13111301
13121302 if span_streaming :
@@ -1390,9 +1380,7 @@ def dummy_traces_sampler(sampling_context):
13901380 sentry_init (
13911381 traces_sampler = dummy_traces_sampler ,
13921382 traces_sample_rate = 1.0 ,
1393- _experiments = {
1394- "trace_lifecycle" : "stream" if span_streaming else "static" ,
1395- },
1383+ trace_lifecycle = "stream" if span_streaming else "static" ,
13961384 )
13971385
13981386 app = SentryAsgiMiddleware (asgi3_app , transaction_style = transaction_style )
@@ -1415,9 +1403,7 @@ async def test_custom_transaction_name(
14151403):
14161404 sentry_init (
14171405 traces_sample_rate = 1.0 ,
1418- _experiments = {
1419- "trace_lifecycle" : "stream" if span_streaming else "static" ,
1420- },
1406+ trace_lifecycle = "stream" if span_streaming else "static" ,
14211407 )
14221408 app = SentryAsgiMiddleware (asgi3_custom_transaction_app )
14231409
@@ -1505,11 +1491,9 @@ async def app(scope, receive, send):
15051491 await send ({"type" : "http.response.body" , "body" : b"Hello, world!" })
15061492
15071493 kwargs = dict (init_kwargs )
1508- experiments = kwargs .pop ("_experiments" , {})
15091494 sentry_init (
15101495 trace_lifecycle = "stream" ,
15111496 traces_sample_rate = 1.0 ,
1512- _experiments = experiments ,
15131497 ** kwargs ,
15141498 )
15151499 sentry_app = SentryAsgiMiddleware (app )
0 commit comments