Geoffrey Keating
05/05/2022, 4:08 PMprefect_test_harness
provides an environment for flows to be tested, how might I go about testing a task in Prefect 2.0? It seems like calling .run()
on tasks has not made it over from 1.0 yet.Anna Geller
"weβre planning to create a way to test tasks outside of flows"
Nate
05/05/2022, 4:30 PMprefect-slack
(link)Geoffrey Keating
05/05/2022, 5:04 PMNate
05/05/2022, 6:02 PM.fn()
method on tasks like
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
to call tasks out of context