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 authored and ocelotl committed Aug 1, 2024
1 parent 6f366a6 commit 7053d69
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ def test_set_attributes_from_context(self):
span.attributes.get(SpanAttributes.MESSAGING_DESTINATION), "celery"
)

self.assertEqual(span.attributes["celery.delivery_info"], str({"eager": True}))
self.assertEqual(
span.attributes["celery.delivery_info"], str({"eager": True})
)
self.assertEqual(span.attributes.get("celery.eta"), "soon")
self.assertEqual(span.attributes.get("celery.expires"), "later")
self.assertEqual(span.attributes.get("celery.hostname"), "localhost")

self.assertEqual(span.attributes.get("celery.reply_to"), "44b7f305")
self.assertEqual(span.attributes.get("celery.retries"), 4)
self.assertEqual(span.attributes.get("celery.timelimit"), ("now", "later"))
self.assertEqual(
span.attributes.get("celery.timelimit"), ("now", "later")
)
self.assertNotIn("custom_meta", span.attributes)

def test_set_attributes_not_recording(self):
Expand Down Expand Up @@ -128,7 +132,9 @@ def test_set_attributes_partial_timelimit_soft_limit(self):
}
span = trace._Span("name", mock.Mock(spec=trace_api.SpanContext))
utils.set_attributes_from_context(span, context)
self.assertEqual(span.attributes.get("celery.timelimit"), ("", "later"))
self.assertEqual(
span.attributes.get("celery.timelimit"), ("", "later")
)

def test_set_attributes_from_context_empty_keys(self):
# it should not extract empty keys
Expand Down

0 comments on commit 7053d69

Please sign in to comment.