@@ -455,6 +455,7 @@ def test_decorate_basic_publish_when_span_is_not_recording(
455
455
)
456
456
self .assertEqual (retval , callback .return_value )
457
457
458
+ # pylint: disable=too-many-statements
458
459
@mock .patch ("opentelemetry.instrumentation.pika.utils._get_span" )
459
460
@mock .patch ("opentelemetry.propagate.extract" )
460
461
@mock .patch ("opentelemetry.context.detach" )
@@ -471,18 +472,16 @@ def test_decorate_deque_proxy(
471
472
returned_span = mock .MagicMock ()
472
473
get_span .return_value = returned_span
473
474
consume_hook = mock .MagicMock ()
474
- mock_task_name = "mock_task_name"
475
475
tracer = mock .MagicMock ()
476
476
generator_info = mock .MagicMock (
477
477
spec = _QueueConsumerGeneratorInfo ,
478
478
pending_events = mock .MagicMock (spec = collections .deque ),
479
- consumer_tag = mock_task_name ,
479
+ consumer_tag = " mock_task_name" ,
480
480
)
481
481
method = mock .MagicMock (spec = Basic .Deliver )
482
482
method .exchange = "test_exchange"
483
483
properties = mock .MagicMock ()
484
- mock_body = b"mock_body"
485
- evt = _ConsumerDeliveryEvt (method , properties , mock_body )
484
+ evt = _ConsumerDeliveryEvt (method , properties , b"mock_body" )
486
485
generator_info .pending_events .popleft .return_value = evt
487
486
proxy = utils .ReadyMessagesDequeProxy (
488
487
generator_info .pending_events , generator_info , tracer , consume_hook
@@ -504,7 +503,7 @@ def test_decorate_deque_proxy(
504
503
properties ,
505
504
destination = method .exchange ,
506
505
span_kind = SpanKind .CONSUMER ,
507
- task_name = mock_task_name ,
506
+ task_name = generator_info . consumer_tag ,
508
507
operation = MessagingOperationValues .RECEIVE ,
509
508
)
510
509
consume_hook .assert_called_once ()
@@ -535,7 +534,7 @@ def test_decorate_deque_proxy(
535
534
properties ,
536
535
destination = method .exchange ,
537
536
span_kind = SpanKind .CONSUMER ,
538
- task_name = mock_task_name ,
537
+ task_name = generator_info . consumer_tag ,
539
538
operation = MessagingOperationValues .RECEIVE ,
540
539
)
541
540
consume_hook .assert_called_once ()
0 commit comments