Skip to content

Commit 7f626ec

Browse files
Refactor enrich_span assertion in test_utils.py
- tightened the test_get_span assertion to verify _enrich_span is called with destination, not task_name. - changed enrich_span.assert_called_once() to enrich_span.assert_called_once_with(...) with destination as the argument.
1 parent 42f8763 commit 7f626ec

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • instrumentation/opentelemetry-instrumentation-pika/tests

instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ def test_get_span(
4747
tracer.start_span.assert_called_once_with(
4848
name=generate_span_name.return_value, kind=span_kind
4949
)
50-
enrich_span.assert_called_once()
50+
enrich_span.assert_called_once_with(
51+
tracer.start_span.return_value,
52+
channel,
53+
properties,
54+
destination,
55+
None,
56+
)
5157

5258
@mock.patch("opentelemetry.context.get_value")
5359
@mock.patch("opentelemetry.instrumentation.pika.utils._generate_span_name")

0 commit comments

Comments
 (0)