Skip to content

Commit

Permalink
refactor(opentelemetry-instrumentation-celery): fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmrebughini committed Jul 30, 2024
1 parent 59f63fc commit e858553
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def test_task(self):

self.assertEqual(0, len(consumer.events))

self.assertEqual(producer.name, "apply_async/tests.celery_test_tasks.task_add")
self.assertEqual(
producer.name, "apply_async/tests.celery_test_tasks.task_add"
)
self.assertEqual(producer.kind, SpanKind.PRODUCER)
self.assertSpanHasAttributes(
producer,
Expand Down Expand Up @@ -103,7 +105,9 @@ def test_task_raises(self):

consumer, producer = spans

self.assertEqual(consumer.name, "run/tests.celery_test_tasks.task_raises")
self.assertEqual(
consumer.name, "run/tests.celery_test_tasks.task_raises"
)
self.assertEqual(consumer.kind, SpanKind.CONSUMER)
self.assertSpanHasAttributes(
consumer,
Expand All @@ -123,7 +127,9 @@ def test_task_raises(self):
self.assertIn(SpanAttributes.EXCEPTION_STACKTRACE, event.attributes)

# TODO: use plain assertEqual after 1.25 is released (https://github.com/open-telemetry/opentelemetry-python/pull/3837)
self.assertIn("CustomError", event.attributes[SpanAttributes.EXCEPTION_TYPE])
self.assertIn(
"CustomError", event.attributes[SpanAttributes.EXCEPTION_TYPE]
)

self.assertEqual(
event.attributes[SpanAttributes.EXCEPTION_MESSAGE],
Expand Down Expand Up @@ -219,7 +225,9 @@ def test_hidden_task(self):
self.assertEqual(consumer.name, "run/tests.test_tasks.hidden_task")
self.assertEqual(consumer.kind, SpanKind.CONSUMER)

self.assertEqual(producer.name, "apply_async/tests.test_tasks.hidden_task")
self.assertEqual(
producer.name, "apply_async/tests.test_tasks.hidden_task"
)
self.assertEqual(producer.kind, SpanKind.PRODUCER)

self.assertNotEqual(consumer.parent, producer.context)
Expand Down

0 comments on commit e858553

Please sign in to comment.