I have a question regarding passing `LocalResult()...
# ask-community
a
I have a question regarding passing `LocalResult()`s in a flow of flows while testing the parent flow. The pattern here (subflow result passing) makes sense, but it seems like its designed for when running in prod on Server or Cloud. Is there a way to fudge a
flow_id
for
get_task_run_result
when just calling
flow.run()
for testing, or should I be thinking about this in an entirely different way when testing?
k
Hey @Adam Shamlian, unfortunately, I don’t think there is a way because these tasks are designed to interact with a backend. Some users spin up Prefect Server for local testing. Some people also use the
case
task as an if-else to separate local testing.
a
Thanks for the swift reply. I will probably use the case approach with a "magic" test-only method. This gets my gears turning about dependency injection in Prefect, which strikes me as a cool possibility (though I know DI isn't necessarily the go-to approach in python), particularly for environment level switching. Anyways, thanks again!
👍 1