The cheapest Airflow test loads every Dag file the way the Dag processor does and fails if any of them breaks:
from airflow.models import DagBag
def test_no_import_errors():
bag = DagBag(include_examples=False)
assert bag.import_errors == {}
bag.import_errors maps each broken file to its error: a bad import, a cycle, a duplicate task id, schedule_interval in Airflow 3. bag.dags maps each Dag id to its Dag, so the same bag can enforce policies: every Dag has tags, an owner, retries, a timeout. Run these tests in CI on every change, so a broken file never reaches the scheduler, where it would make the Dag disappear from the UI.
include_examples=False keeps Airflow's example Dags out. In this workspace you edit test_dags.py and run pytest in the Terminal. The check runs your tests on the real files, which must pass, and on a copy with a fault, which your tests must catch.
Fails, with the file and the error, whenever any Dag file cannot be loaded.