@@ -396,22 +396,18 @@ def test_omit_url_data_if_parsing_fails(sentry_init, capture_events, httpx_mock)
396396 assert SPANDATA .HTTP_QUERY not in event ["breadcrumbs" ]["values" ][0 ]["data" ]
397397
398398
399- @pytest .mark .parametrize ("enable_http_request_source" , [None , False ])
400399@pytest .mark .parametrize (
401400 "httpx_client" ,
402401 (httpx .Client (), httpx .AsyncClient ()),
403402)
404- def test_request_source_disabled (
405- sentry_init , capture_events , enable_http_request_source , httpx_client , httpx_mock
406- ):
403+ def test_request_source_disabled (sentry_init , capture_events , httpx_client , httpx_mock ):
407404 httpx_mock .add_response ()
408405 sentry_options = {
409406 "integrations" : [HttpxIntegration ()],
410407 "traces_sample_rate" : 1.0 ,
408+ "enable_http_request_source" : False ,
411409 "http_request_source_threshold_ms" : 0 ,
412410 }
413- if enable_http_request_source is not None :
414- sentry_options ["enable_http_request_source" ] = enable_http_request_source
415411
416412 sentry_init (** sentry_options )
417413
@@ -438,18 +434,23 @@ def test_request_source_disabled(
438434 assert SPANDATA .CODE_FUNCTION not in data
439435
440436
437+ @pytest .mark .parametrize ("enable_http_request_source" , [None , True ])
441438@pytest .mark .parametrize (
442439 "httpx_client" ,
443440 (httpx .Client (), httpx .AsyncClient ()),
444441)
445- def test_request_source_enabled (sentry_init , capture_events , httpx_client , httpx_mock ):
442+ def test_request_source_enabled (
443+ sentry_init , capture_events , enable_http_request_source , httpx_client , httpx_mock
444+ ):
446445 httpx_mock .add_response ()
447446 sentry_options = {
448447 "integrations" : [HttpxIntegration ()],
449448 "traces_sample_rate" : 1.0 ,
450- "enable_http_request_source" : True ,
451449 "http_request_source_threshold_ms" : 0 ,
452450 }
451+ if enable_http_request_source is not None :
452+ sentry_options ["enable_http_request_source" ] = enable_http_request_source
453+
453454 sentry_init (** sentry_options )
454455
455456 events = capture_events ()
0 commit comments