Methods of testing nested celery tasks

Viewed 119

To simplify the question, suppose we have a celery task which calls other celery tasks.

My understanding is that there no way to "patch" (as in unit test mock) the task that is being queued within the task you want to test, and therefore you have no means of controlling that nested/queued task internally.

Also, my understanding is that the only way to verify the outcome of this [task you want to test], is to do integration tests, and verify the external effects of the whole flow you just executed.

Therefore it would seem the best solution is avoid as much as possible queuing tasks within tasks and when you do so, to keep it as basic as possible?

Can someone confirm this or provide alternative views on the topic?

Thank you

0 Answers
Related