File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import pytest
55from airflow .models import DagBag , Variable
66from airflow .timetables .trigger import CronTriggerTimetable
7- from airflow .utils .db import initdb
7+ from airflow .utils .db import resetdb , initdb
88from dags .daily_materialized_views_update import DAILY_MATERIALISED_VIEWS_DAG_NAME
99from dags .fetch_notices_by_date import FETCHER_DAG_NAME
1010from tests import AIRFLOW_DAG_FOLDER
1111
12- @pytest .fixture (scope = "module " , autouse = True )
12+ @pytest .fixture (scope = "session " , autouse = True )
1313def setup_airflow ():
1414 # Setup
1515 temp_db_file = tempfile .NamedTemporaryFile (mode = "w+" , suffix = ".db" )
1616 os .environ ["AIRFLOW__CORE__SQL_ALCHEMY_CONN" ] = f"sqlite:///{ temp_db_file .name } "
1717 os .environ ["AIRFLOW__CORE__LOAD_EXAMPLES" ] = "False"
1818 os .environ ["AIRFLOW__CORE__UNIT_TEST_MODE" ] = "True"
19- initdb ()
19+ initdb (use_migration_files = False )
2020
2121 # Run tests
2222 yield
You can’t perform that action at this time.
0 commit comments