David Clements
02/16/2021, 12:20 AMChris White
flow.replace
which will allow you to swap out a given task with another task; at this moment Prefect doesn’t offer an off-the-shelf task mock, but now that you’ve asked I think it’s something we’ll look into!
For other forms of testing (injecting state, testing triggers, etc.) check out this SO answer: https://stackoverflow.com/questions/65220781/how-to-get-in-prefect-core-local-task-final-state/65227575#65227575my_task.run()
with the appropriate kwargs and with any mocks you may need