File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -160,12 +160,17 @@ def test_validate_parameters_call():
160
160
assert "region_task was called with a parameter that cannot be JSON encoded" in str (err )
161
161
162
162
163
+ @override_settings (SILO_MODE = SiloMode .CONTROL )
163
164
@patch ("sentry.taskworker.retry.current_task" )
164
165
@patch ("sentry_sdk.capture_exception" )
165
166
def test_retry_on (capture_exception , current_task ):
167
+ class ExpectedException (Exception ):
168
+ pass
169
+
170
+ current_task .retry .side_effect = ExpectedException ("some exception" )
166
171
167
- # In reality current_task.retry will cause the given exception to be re-raised but we patch it here so no need to . raises :bufo-shrug :
168
- retry_on_task ("bruh" )
172
+ with pytest . raises ( ExpectedException ) :
173
+ retry_on_task ("bruh" )
169
174
170
175
assert capture_exception .call_count == 1
171
176
assert current_task .retry .call_count == 1
You can’t perform that action at this time.
0 commit comments