diff --git a/tests/integrations/celery/test_celery.py b/tests/integrations/celery/test_celery.py index ec3e723c22..26edd39b6c 100644 --- a/tests/integrations/celery/test_celery.py +++ b/tests/integrations/celery/test_celery.py @@ -155,6 +155,10 @@ def dummy_task(x, y): error_event["contexts"]["trace"]["trace_id"] == scope._propagation_context["trace_id"] ) + assert ( + error_event["contexts"]["trace"]["span_id"] + != scope._propagation_context["span_id"] + ) assert error_event["transaction"] == "dummy_task" assert "celery_task_id" in error_event["tags"] assert error_event["extra"]["celery-job"] == dict( @@ -262,6 +266,18 @@ def dummy_task(): assert exception["type"] == "ZeroDivisionError" +def test_ignore_expected(capture_events, celery): + events = capture_events() + + @celery.task(name="dummy_task", throws=(ZeroDivisionError,)) + def dummy_task(x, y): + return x / y + + dummy_task.delay(1, 2) + dummy_task.delay(1, 0) + assert not events + + @pytest.mark.skip( reason="This tests for a broken rerun in Celery 3. We don't support Celery 3 anymore." ) @@ -301,18 +317,6 @@ def dummy_task(x, y): assert stack_lengths == [2, 2] -def test_ignore_expected(capture_events, celery): - events = capture_events() - - @celery.task(name="dummy_task", throws=(ZeroDivisionError,)) - def dummy_task(x, y): - return x / y - - dummy_task.delay(1, 2) - dummy_task.delay(1, 0) - assert not events - - @pytest.mark.xfail( (4, 2, 0) <= VERSION < (4, 4, 3), strict=True,