File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from dags .fetch_notices_by_date import FETCHER_DAG_NAME
1010from tests import AIRFLOW_DAG_FOLDER
1111
12- @pytest .fixture (scope = "function" , autouse = True )
12+ @pytest .fixture (scope = "function" )
1313def setup_airflow ():
14- # Setup
1514 temp_db_file = tempfile .NamedTemporaryFile (mode = "w+" , suffix = ".db" )
1615 os .environ ["AIRFLOW__CORE__SQL_ALCHEMY_CONN" ] = f"sqlite:///{ temp_db_file .name } "
1716 os .environ ["AIRFLOW__CORE__LOAD_EXAMPLES" ] = "False"
1817 os .environ ["AIRFLOW__CORE__UNIT_TEST_MODE" ] = "True"
1918 initdb ()
2019
21- # Run tests
22- yield
23-
24- # Cleanup
25- temp_db_file .close ()
2620
2721@pytest .fixture
28- def dag_bag (dag_materialised_view_update_schedule_variable_name , dag_fetch_schedule_variable_name ) -> DagBag :
22+ def dag_bag (dag_materialised_view_update_schedule_variable_name ,
23+ dag_fetch_schedule_variable_name ,
24+ setup_airflow ) -> DagBag :
2925 Variable .delete (key = dag_materialised_view_update_schedule_variable_name )
3026 Variable .delete (key = dag_fetch_schedule_variable_name )
3127 return DagBag (
You can’t perform that action at this time.
0 commit comments