Hello Prefect!
Can somebody provide some guidance on the best way to test failure paths in Prefect flows? Can I inject state into a flow during setup in someway to ensure the failure behavior is working as expected? Thanks in advance!
k
Kevin Kho
05/26/2021, 2:44 PM
Hi @Robert Bastian, I just raise
ValueError
or any error inside a task where I want it to fail. You can also use Parameters and then inside a task,
if param==True: raise ValueError
👀 1
Kevin Kho
05/26/2021, 3:38 PM
There are hooks for local testing, which includes the ability to inject state to a local run. Check this