# Path: opentracing_instrumentation/client_hooks/celery.py
# def task_apply_async_wrapper(task, args=None, kwargs=None, **other_kwargs):
# def set_common_tags(span, task, span_kind):
# def before_task_publish_handler(headers, **kwargs):
# def task_prerun_handler(task, task_id, **kwargs):
# def finish_current_span(task, exc_type=None, exc_val=None, exc_tb=None):
# def task_success_handler(sender, **kwargs):
# def task_failure_handler(sender, exception, traceback, **kwargs):
#     def _install_patches(self):
#     def _reset_patches(self):
# class CeleryPatcher(Patcher):


import celery as celery_module
import mock
import pytest
from celery import Celery
from celery.signals import (
    before_task_publish, after_task_publish, task_postrun
)
from celery.states import SUCCESS, FAILURE
from celery.worker import state as celery_worker_state
from kombu import Connection
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import celery as celery_hooks




CELERY_3 = celery_module.__version__.split('.', 1)[0] == '3'


@pytest.fixture(autouse=True, scope='module')
def patch_celery():

# Path: opentracing_instrumentation/client_hooks/celery.py
# def task_apply_async_wrapper(task, args=None, kwargs=None, **other_kwargs):
# def set_common_tags(span, task, span_kind):
# def before_task_publish_handler(headers, **kwargs):
# def task_prerun_handler(task, task_id, **kwargs):
# def finish_current_span(task, exc_type=None, exc_val=None, exc_tb=None):
# def task_success_handler(sender, **kwargs):
# def task_failure_handler(sender, exception, traceback, **kwargs):
#     def _install_patches(self):
#     def _reset_patches(self):
# class CeleryPatcher(Patcher):


# Path: tests/opentracing_instrumentation/test_celery.py
import celery as celery_module
import mock
import pytest
from celery import Celery
from celery.signals import (
    before_task_publish, after_task_publish, task_postrun
)
from celery.states import SUCCESS, FAILURE
from celery.worker import state as celery_worker_state
from kombu import Connection
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import celery as celery_hooks





CELERY_3 = celery_module.__version__.split('.', 1)[0] == '3'


@pytest.fixture(autouse=True, scope='module')
def patch_celery():

    celery_hooks.install_patches()