Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions tests/integrations/celery/test_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def test_simple_with_performance(
):
celery = init_celery(
traces_sample_rate=1.0,
data_collection={},
)

@celery.task(name="dummy_task")
Expand Down Expand Up @@ -150,7 +149,6 @@ def dummy_task(x, y):
def test_simple_without_performance(capture_events, init_celery, celery_invocation):
celery = init_celery(
traces_sample_rate=None,
data_collection={},
)
events = capture_events()

Expand Down Expand Up @@ -261,7 +259,6 @@ def test_transaction_events(
):
celery = init_celery(
traces_sample_rate=1.0,
data_collection={},
)

@celery.task(name="dummy_task")
Expand Down Expand Up @@ -343,7 +340,7 @@ def dummy_task():


def test_simple_no_propagation(capture_events, init_celery):
celery = init_celery(propagate_traces=False, data_collection={})
celery = init_celery(propagate_traces=False)
events = capture_events()

@celery.task(name="dummy_task")
Expand Down Expand Up @@ -455,7 +452,7 @@ def test_traces_sampler_gets_task_info_in_sampling_context(
DictionaryContaining, # noqa:N803
):
traces_sampler = mock.Mock(return_value=1.0)
celery = init_celery(traces_sampler=traces_sampler, data_collection={})
celery = init_celery(traces_sampler=traces_sampler)

@celery.task(name="dog_walk")
def walk_dogs(x, y):
Expand Down Expand Up @@ -527,7 +524,7 @@ def dummy_task(self, x, y):


def test_baggage_propagation(init_celery):
celery = init_celery(traces_sample_rate=1.0, release="abcdef", data_collection={})
celery = init_celery(traces_sample_rate=1.0, release="abcdef")

@celery.task(name="dummy_task", bind=True)
def dummy_task(self, x, y):
Expand Down Expand Up @@ -564,7 +561,6 @@ def test_sentry_propagate_traces_override(init_celery):
propagate_traces=True,
traces_sample_rate=1.0,
release="abcdef",
data_collection={},
)

@celery.task(name="dummy_task", bind=True)
Expand Down Expand Up @@ -592,7 +588,6 @@ def dummy_task(self, message):
def test_apply_async_manually_span(sentry_init):
sentry_init(
integrations=[CeleryIntegration()],
data_collection={},
)

def dummy_function(*args, **kwargs):
Expand All @@ -605,7 +600,7 @@ def dummy_function(*args, **kwargs):


def test_apply_async_no_args(init_celery):
celery = init_celery(data_collection={})
celery = init_celery()

@celery.task
def example_task():
Expand All @@ -629,7 +624,6 @@ def test_messaging_destination_name_default_exchange(
):
celery_app = init_celery(
traces_sample_rate=1.0,
data_collection={},
)
mock_request.delivery_info = {"routing_key": routing_key, "exchange": ""}

Expand Down Expand Up @@ -659,7 +653,6 @@ def test_messaging_destination_name_nondefault_exchange(
"""
celery_app = init_celery(
traces_sample_rate=1.0,
data_collection={},
)
mock_request.delivery_info = {"routing_key": "celery", "exchange": "custom"}

Expand All @@ -679,7 +672,6 @@ def task(): ...
def test_messaging_id(init_celery, capture_items):
celery = init_celery(
traces_sample_rate=1.0,
data_collection={},
)

@celery.task
Expand All @@ -698,7 +690,6 @@ def example_task(): ...
def test_retry_count_zero(init_celery, capture_items):
celery = init_celery(
traces_sample_rate=1.0,
data_collection={},
)

@celery.task()
Expand All @@ -720,7 +711,6 @@ def test_retry_count_nonzero(mock_request, init_celery, capture_items):

celery = init_celery(
traces_sample_rate=1.0,
data_collection={},
)

@celery.task()
Expand All @@ -740,7 +730,6 @@ def task(): ...
def test_messaging_system(system, init_celery, capture_items):
celery = init_celery(
traces_sample_rate=1.0,
data_collection={},
)

# Does not need to be a real URL, since we use always eager
Expand Down Expand Up @@ -771,7 +760,6 @@ def publish(*args, **kwargs):
sentry_init(
integrations=[CeleryIntegration()],
traces_sample_rate=1.0,
data_collection={},
)
celery = Celery(__name__, broker=f"{system}://example.com") # noqa: E231

Expand Down Expand Up @@ -801,7 +789,6 @@ def task(): ...
def test_receive_latency(init_celery, capture_items):
celery = init_celery(
traces_sample_rate=1.0,
data_collection={},
)

@celery.task()
Expand All @@ -821,7 +808,6 @@ def task(): ...
def tests_span_origin_consumer(init_celery, capture_items):
celery = init_celery(
traces_sample_rate=1.0,
data_collection={},
)
celery.conf.broker_url = "redis://example.com" # noqa: E231

Expand Down Expand Up @@ -850,7 +836,6 @@ def publish(*args, **kwargs):
sentry_init(
integrations=[CeleryIntegration()],
traces_sample_rate=1.0,
data_collection={},
)
celery = Celery(__name__, broker="redis://example.com") # noqa: E231

Expand Down Expand Up @@ -885,7 +870,6 @@ def test_send_task_wrapped(
sentry_init(
integrations=[CeleryIntegration()],
traces_sample_rate=1.0,
data_collection={},
)
celery = Celery(__name__, broker="redis://example.com") # noqa: E231

Expand Down Expand Up @@ -937,7 +921,6 @@ def test_user_custom_headers_accessible_in_task(init_celery):
"""
celery = init_celery(
traces_sample_rate=1.0,
data_collection={},
)

@celery.task(name="custom_headers_task", bind=True)
Expand Down
Loading