diff --git a/tests/conftest.py b/tests/conftest.py index bcfc91f1345ed..745ec9f4178b3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,6 +25,7 @@ # We should set these before loading _any_ of the rest of airflow so that the # unit test mode config is set as early as possible. +assert "airflow" not in sys.modules, "No airflow module can be imported before these lines" tests_directory = os.path.dirname(os.path.realpath(__file__)) os.environ["AIRFLOW__CORE__DAGS_FOLDER"] = os.path.join(tests_directory, "dags")