Skip to content

Commit 67ca0e5

Browse files
committed
patch correct func
1 parent 50db70f commit 67ca0e5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/integrations/opentelemetry/test_sampler.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,17 @@ def test_sampling_traces_sample_rate_50(sentry_init, capture_envelopes):
7171

7272
envelopes = capture_envelopes()
7373

74-
with mock.patch("random.random", return_value=0.2): # drop
74+
with mock.patch(
75+
"sentry_sdk.tracing_utils.Random.uniform", return_value=0.2
76+
): # drop
7577
with sentry_sdk.start_span(description="request a"):
7678
with sentry_sdk.start_span(description="cache a"):
7779
with sentry_sdk.start_span(description="db a"):
7880
...
7981

80-
with mock.patch("random.random", return_value=0.7): # keep
82+
with mock.patch(
83+
"sentry_sdk.tracing_utils.Random.uniform", return_value=0.7
84+
): # keep
8185
with sentry_sdk.start_span(description="request b"):
8286
with sentry_sdk.start_span(description="cache b"):
8387
with sentry_sdk.start_span(description="db b"):

0 commit comments

Comments
 (0)