22
33pytest .importorskip ("celery" )
44
5- from sentry_sdk import Hub , configure_scope
5+ from sentry_sdk import Hub
66from sentry_sdk .integrations .celery import CeleryIntegration
77
88from celery import Celery , VERSION
@@ -69,8 +69,8 @@ def dummy_task(x, y):
6969 assert not events
7070
7171
72- def test_broken_prerun (capture_events , init_celery , connect_signal ):
73- from celery .signals import task_prerun , task_postrun
72+ def test_broken_prerun (init_celery , connect_signal ):
73+ from celery .signals import task_prerun
7474
7575 def crash (* args , ** kwargs ):
7676 1 / 0
@@ -81,7 +81,6 @@ def crash(*args, **kwargs):
8181 connect_signal (task_prerun , crash )
8282 celery = init_celery ()
8383
84- events = capture_events ()
8584 assert len (Hub .current ._stack ) == 1
8685
8786 @celery .task (name = "dummy_task" )
@@ -90,7 +89,7 @@ def dummy_task(x, y):
9089 return x / y
9190
9291 try :
93- result = dummy_task .delay (2 , 2 )
92+ dummy_task .delay (2 , 2 )
9493 except ZeroDivisionError :
9594 if VERSION >= (4 ,):
9695 raise
0 commit comments