Exceptions cannot be compared by ==. They can be compared using is but this
will fail if the exception is serialized/deserialized so this utility does its
best to assert equality using the type and args used to initialize the exception
prefect_test_harness(server_startup_timeout: int | None = 30)
Temporarily run flows against a local SQLite database for testing.Args:
server_startup_timeout: The maximum time to wait for the server to start.
Defaults to 30 seconds. If set to None, the value of
PREFECT_SERVER_EPHEMERAL_STARTUP_TIMEOUT_SECONDS will be used.
Examples:
from prefect import flowfrom prefect.testing.utilities import prefect_test_harness@flowdef my_flow(): return 'Done!'with prefect_test_harness(): assert my_flow() == 'Done!' # run against temporary db