mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-08-01 09:13:23 +08:00
21 lines
482 B
Python
21 lines
482 B
Python
import unittest
|
|
from ddtrace import Pin
|
|
|
|
|
|
class CeleryPatchTest(unittest.TestCase):
|
|
def test_patch_after_import(self):
|
|
import celery
|
|
from ddtrace import patch
|
|
patch(celery=True)
|
|
|
|
app = celery.Celery()
|
|
assert Pin.get_from(app) is not None
|
|
|
|
def test_patch_before_import(self):
|
|
from ddtrace import patch
|
|
patch(celery=True)
|
|
import celery
|
|
|
|
app = celery.Celery()
|
|
assert Pin.get_from(app) is not None
|