Geoffrey Keating05/05/2022, 4:08 PM
provides an environment for flows to be tested, how might I go about testing a task in Prefect 2.0? It seems like calling
on tasks has not made it over from 1.0 yet.
Anna Geller05/05/2022, 4:11 PM
"we’re planning to create a way to test tasks outside of flows"
Nate05/05/2022, 4:30 PM
Geoffrey Keating05/05/2022, 5:04 PM
Nate05/05/2022, 6:02 PM
method on tasks like
to call tasks out of context
import pytest from my_prefect_collection.tasks import my_task async def test_successful_task(mock_successful_calls): my_task_result = await my_task.fn() assert type(trigger_sync_result) is whatever