File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 66
77import sentry_sdk
88from sentry_sdk import start_span , capture_exception
9+ from sentry_sdk .tracing import BAGGAGE_HEADER_NAME
910from sentry_sdk .tracing_utils import Baggage
1011from sentry_sdk .utils import logger
1112
@@ -59,9 +60,11 @@ def test_uses_traces_sample_rate_correctly(
5960):
6061 sentry_init (traces_sample_rate = traces_sample_rate )
6162
62- baggage = Baggage (sentry_items = {"sample_rand" : "0.500000" })
63- root_span = start_span (name = "dogpark" , baggage = baggage )
64- assert root_span .sampled is expected_decision
63+ with sentry_sdk .continue_trace (
64+ {BAGGAGE_HEADER_NAME : "sentry-sample_rand=0.500000" }
65+ ):
66+ with start_span (name = "dogpark" ) as root_span :
67+ assert root_span .sampled is expected_decision
6568
6669
6770@pytest .mark .parametrize (
You can’t perform that action at this time.
0 commit comments