prefect.testing
fixtures
prefect.testing.fixtures
Functions
add_prefect_loggers_to_caplog
is_port_in_use
use_hosted_api_server
Sets PREFECT_API_URL
to the test session’s hosted API endpoint.
disable_hosted_api_server
Disables the hosted API server by setting PREFECT_API_URL
to None
.
enable_ephemeral_server
Enables the ephemeral server by setting PREFECT_SERVER_ALLOW_EPHEMERAL_MODE
to True
.
mock_anyio_sleep
Mock sleep used to not actually sleep but to set the current time to now + sleep delay seconds while still yielding to other tasks in the event loop.
Provides “assert_sleeps_for” context manager which asserts a sleep time occurred within the context while using the actual runtime of the context as a tolerance.
recorder
puppeteer
events_api_url
events_cloud_api_url
mock_should_emit_events
asserting_events_worker
asserting_and_emitting_events_worker
reset_worker_events
enable_lineage_events
A fixture that ensures lineage events are enabled.