Skip to content

Commit 7467b19

Browse files
test: Assert traces_sampler called once (#4450)
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. <!-- Describe your PR here --> --- Thank you for contributing to `sentry-python`! Please add tests to validate your changes, and lint your code using `tox -e linters`. Running the test suite on your PR might require maintainer approval.
1 parent f5fb6e7 commit 7467b19

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)