Skip to content

Commit bbc7605

Browse files
test: Assert traces_sampler called once
Currently, this test only asserts that the `traces_sampler` is called at least once with the given arguments. However, we would expect it to be called exactly once. This PR changes the assertion to assert that the `traces_sampler` was called exactly one time, and that that call included the given arguments.
1 parent cfbb8db commit bbc7605

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/tracing/test_sampling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def test_passes_attributes_from_start_span_to_traces_sampler(
218218
sentry_init(traces_sampler=traces_sampler)
219219

220220
with start_span(attributes={"dogs": "yes", "cats": "maybe"}):
221-
traces_sampler.assert_any_call(
221+
traces_sampler.assert_called_once_with(
222222
DictionaryContaining({"dogs": "yes", "cats": "maybe"})
223223
)
224224

0 commit comments

Comments
 (0)