@@ -139,14 +139,14 @@ def add_with_task_args(self, a, b):
139139 create .assert_called_once_with (
140140 "new_name" ,
141141 value_max = 10 ,
142- data = {"foo" : "bar" , "celery_task_args" : ( 2 , 2 ) , "celery_task_kwargs" : {}},
142+ data = {"foo" : "bar" , "celery_task_args" : [ 2 , 2 ] , "celery_task_kwargs" : {}},
143143 status = StatusEnum .PENDING ,
144144 )
145145
146146
147147def test_celery_record_task_kwargs (celery_session_app , celery_session_worker , bind_settings ):
148148 @celery_session_app .task (bind = True , base = Task )
149- def add_with_task_args (self , a , b , c = 0 ):
149+ def add_with_task_kwargs (self , a , b , c = 0 ):
150150 assert self .taskbadger_task is not None
151151 return a + b + c
152152
@@ -160,7 +160,7 @@ def add_with_task_args(self, a, b, c=0):
160160 create .return_value = task_for_test ()
161161
162162 actions = [Action ("stale" , integration = EmailIntegration (to = "test@test.com" ))]
163- result = add_with_task_args .delay (
163+ result = add_with_task_kwargs .delay (
164164 2 ,
165165 2 ,
166166 c = 3 ,
@@ -174,7 +174,7 @@ def add_with_task_args(self, a, b, c=0):
174174 create .assert_called_once_with (
175175 "new_name" ,
176176 value_max = 10 ,
177- data = {"celery_task_args" : ( 2 , 2 ) , "celery_task_kwargs" : {"c" : 3 }},
177+ data = {"celery_task_args" : [ 2 , 2 ] , "celery_task_kwargs" : {"c" : 3 }},
178178 actions = actions ,
179179 status = StatusEnum .PENDING ,
180180 )
@@ -189,7 +189,7 @@ def __init__(self, a, b):
189189 register_type (A , "A" , lambda o : [o .a , o .b ], lambda o : A (* o ))
190190
191191 @celery_session_app .task (bind = True , base = Task )
192- def add_with_task_args (self , a ):
192+ def add_task_custom_serialization (self , a ):
193193 assert self .taskbadger_task is not None
194194 return a .a + a .b
195195
@@ -202,14 +202,14 @@ def add_with_task_args(self, a):
202202 ):
203203 create .return_value = task_for_test ()
204204
205- result = add_with_task_args .delay (
205+ result = add_task_custom_serialization .delay (
206206 A (2 , 2 ),
207207 taskbadger_record_task_args = True ,
208208 )
209209 assert result .get (timeout = 10 , propagate = True ) == 4
210210
211211 create .assert_called_once_with (
212- "tests.test_celery.add_with_task_args " ,
212+ "tests.test_celery.add_task_custom_serialization " ,
213213 data = {"celery_task_args" : [{"__type__" : "A" , "__value__" : [2 , 2 ]}], "celery_task_kwargs" : {}},
214214 status = StatusEnum .PENDING ,
215215 )
0 commit comments