Unit tests check pieces; dag.test() runs the whole Dag in one process, task after task, without a scheduler:
def test_marigold_sales_runs():
bag = DagBag(include_examples=False)
run = bag.get_dag("marigold_sales").test(logical_date=pendulum.datetime(2026, 11, 8, tz="UTC"))
assert run.state == "success"
regions = run.get_task_instance("by_region").xcom_pull(task_ids="by_region")
It returns the Dag run, so you can check its state and read what each task returned. It is the closest thing to a real run you can put in CI: dependencies, templates, XCom and trigger rules all take part. Give it a fixed logical date so the test reads the same data every time, and supply connections and variables through environment variables (or conn_file_path and variable_file_path).
It is slower than a unit test and still talks to whatever your tasks talk to, so point it at test data. In this workspace it runs on the simulated scheduler.
Run the Dag for a fixed day and check the outcome.