Hello Prefect! Can somebody provide some guidance...
# ask-community
r
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
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
There are hooks for local testing, which includes the ability to inject state to a local run. Check this