also i appreciate a guideline on how to do integration tests locally, i can do easy tests for tasks ...
f
also i appreciate a guideline on how to do integration tests locally, i can do easy tests for tasks but complex flows are not at all testable. i do event based workflows with automations, suspend workflows and they all need deployments to function.
RuntimeError: Flow run cannot be suspended: Cannot suspend flows without a deployment.
meanwhile i was actually doing this for my end2end tests:
Copy code
import asyncio
import pytest
from prefect.testing.utilities import prefect_test_harness

from xflow.deploy import deploy_workflows, deploy_automations


@pytest.fixture(autouse=True, scope="session")
def prefect_db():
    """Enable Prefect test harness for end2end tests."""
    with prefect_test_harness():
        yield


@pytest.fixture(autouse=True, scope="session")
def deployments(prefect_db):
    """Deploy all flows using deploy.py."""
    asyncio.run(deploy_workflows())
    asyncio.run(deploy_automations())
    yield