@@ -503,9 +503,9 @@ def test_span_origin(sentry_init, app, capture_items):
503503 assert segment ["attributes" ]["sentry.origin" ] == "auto.http.sanic"
504504
505505
506- @pytest .mark .parametrize ("init_kwargs , expect_ip" , DATA_COLLECTION_USER_INFO_CASES )
506+ @pytest .mark .parametrize ("data_collection , expect_ip" , DATA_COLLECTION_USER_INFO_CASES )
507507def test_user_ip_address_on_all_spans (
508- sentry_init , app , capture_items , init_kwargs , expect_ip
508+ sentry_init , app , capture_items , data_collection , expect_ip
509509):
510510 app .config .FORWARDED_SECRET = "test"
511511
@@ -519,7 +519,7 @@ def child_span_handler(request):
519519 integrations = [SanicIntegration ()],
520520 default_integrations = False ,
521521 traces_sample_rate = 1.0 ,
522- ** init_kwargs ,
522+ data_collection = data_collection ,
523523 )
524524
525525 items = capture_items ("span" )
@@ -543,17 +543,17 @@ def child_span_handler(request):
543543 assert "user.ip_address" not in child_span ["attributes" ]
544544
545545
546- @pytest .mark .parametrize ("init_kwargs , expect_ip" , DATA_COLLECTION_USER_INFO_CASES )
546+ @pytest .mark .parametrize ("data_collection , expect_ip" , DATA_COLLECTION_USER_INFO_CASES )
547547def test_client_address_span_attribute_data_collection (
548- sentry_init , app , capture_items , init_kwargs , expect_ip
548+ sentry_init , app , capture_items , data_collection , expect_ip
549549):
550550 app .config .FORWARDED_SECRET = "test"
551551
552552 sentry_init (
553553 integrations = [SanicIntegration ()],
554554 default_integrations = False ,
555555 traces_sample_rate = 1.0 ,
556- ** init_kwargs ,
556+ data_collection = data_collection ,
557557 )
558558
559559 items = capture_items ("span" )
@@ -581,55 +581,43 @@ def test_client_address_span_attribute_data_collection(
581581
582582_QUERY_PARAM_DATA_COLLECTION_CASES = [
583583 pytest .param (
584- {"data_collection" : { " url_query_params" : {"mode" : "off" } }},
584+ {"url_query_params" : {"mode" : "off" }},
585585 None ,
586586 id = "data_collection_off" ,
587587 ),
588588 pytest .param (
589- {"data_collection" : {} },
589+ {},
590590 "toy=tennisball&color=red&auth=%5BFiltered%5D" ,
591591 id = "data_collection_denylist_default" ,
592592 ),
593593 pytest .param (
594- {
595- "data_collection" : {
596- "url_query_params" : {"mode" : "denylist" , "terms" : ["toy" ]}
597- }
598- },
594+ {"url_query_params" : {"mode" : "denylist" , "terms" : ["toy" ]}},
599595 "toy=%5BFiltered%5D&color=red&auth=%5BFiltered%5D" ,
600596 id = "data_collection_denylist_custom_terms" ,
601597 ),
602598 pytest .param (
603- {
604- "data_collection" : {
605- "url_query_params" : {"mode" : "allowlist" , "terms" : ["toy" ]}
606- }
607- },
599+ {"url_query_params" : {"mode" : "allowlist" , "terms" : ["toy" ]}},
608600 "toy=tennisball&color=%5BFiltered%5D&auth=%5BFiltered%5D" ,
609601 id = "data_collection_allowlist" ,
610602 ),
611603 pytest .param (
612- {
613- "data_collection" : {
614- "url_query_params" : {"mode" : "allowlist" , "terms" : ["auth" ]}
615- }
616- },
604+ {"url_query_params" : {"mode" : "allowlist" , "terms" : ["auth" ]}},
617605 "toy=%5BFiltered%5D&color=%5BFiltered%5D&auth=%5BFiltered%5D" ,
618606 id = "data_collection_allowlist_sensitive_term" ,
619607 ),
620608]
621609
622610
623611@pytest .mark .parametrize (
624- "init_kwargs , expected_query" , _QUERY_PARAM_DATA_COLLECTION_CASES
612+ "data_collection , expected_query" , _QUERY_PARAM_DATA_COLLECTION_CASES
625613)
626614def test_url_query_data_collection (
627- sentry_init , app , capture_items , init_kwargs , expected_query
615+ sentry_init , app , capture_items , data_collection , expected_query
628616):
629617 sentry_init (
630618 integrations = [SanicIntegration ()],
631619 traces_sample_rate = 1.0 ,
632- ** init_kwargs ,
620+ data_collection = data_collection ,
633621 )
634622
635623 items = capture_items ("span" )
@@ -661,12 +649,12 @@ def test_url_query_data_collection(
661649
662650
663651@pytest .mark .parametrize (
664- "init_kwargs , expected_query" , _QUERY_PARAM_DATA_COLLECTION_CASES
652+ "data_collection , expected_query" , _QUERY_PARAM_DATA_COLLECTION_CASES
665653)
666654def test_url_query_data_collection_event_processor (
667- sentry_init , app , capture_events , init_kwargs , expected_query
655+ sentry_init , app , capture_events , data_collection , expected_query
668656):
669- sentry_init (integrations = [SanicIntegration ()], ** init_kwargs )
657+ sentry_init (integrations = [SanicIntegration ()], data_collection = data_collection )
670658
671659 events = capture_events ()
672660
@@ -766,12 +754,12 @@ def oversized_handler(request):
766754
767755
768756@pytest .mark .parametrize (
769- "init_kwargs , expect_remote_addr" , DATA_COLLECTION_REMOTE_ADDR_CASES
757+ "data_collection , expect_remote_addr" , DATA_COLLECTION_REMOTE_ADDR_CASES
770758)
771759def test_remote_addr_data_collection (
772- sentry_init , app , capture_events , init_kwargs , expect_remote_addr
760+ sentry_init , app , capture_events , data_collection , expect_remote_addr
773761):
774- sentry_init (integrations = [SanicIntegration ()], ** init_kwargs )
762+ sentry_init (integrations = [SanicIntegration ()], data_collection = data_collection )
775763 events = capture_events ()
776764
777765 c = get_client (app )
0 commit comments