File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
tests/integrations/celery Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ def apply_async(*args, **kwargs):
167167
168168 try :
169169 task_started_from_beat = args [1 ][0 ] == "BEAT"
170- except IndexError :
170+ except ( IndexError , TypeError ) :
171171 task_started_from_beat = False
172172
173173 task = args [0 ]
Original file line number Diff line number Diff line change @@ -593,3 +593,18 @@ def dummy_function(*args, **kwargs):
593593 ],
594594 headers = {},
595595 )
596+
597+
598+ def test_apply_async_no_args (init_celery ):
599+ celery = init_celery ()
600+
601+ @celery .task
602+ def example_task ():
603+ return "success"
604+
605+ try :
606+ result = example_task .apply_async (None , {})
607+ except TypeError :
608+ pytest .fail ("Calling `apply_async` without arguments raised a TypeError" )
609+
610+ assert result .get () == "success"
You can’t perform that action at this time.
0 commit comments