From c56a5d1dd99334da5a9b508234f111ef996f20a0 Mon Sep 17 00:00:00 2001 From: Radu Date: Thu, 19 Dec 2024 20:25:40 +0100 Subject: [PATCH] add test --- tests/models/test_dagbag.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/models/test_dagbag.py b/tests/models/test_dagbag.py index f8cbc4d3e6632..6719bf735abfe 100644 --- a/tests/models/test_dagbag.py +++ b/tests/models/test_dagbag.py @@ -47,7 +47,7 @@ from tests.models import TEST_DAGS_FOLDER from tests_common.test_utils import db from tests_common.test_utils.asserts import assert_queries_count -from tests_common.test_utils.config import conf_vars +from tests_common.test_utils.config import conf, conf_vars pytestmark = pytest.mark.db_test @@ -848,6 +848,13 @@ def test_dagbag_dag_collection(self): dagbag = DagBag(dag_folder=TEST_DAGS_FOLDER, include_examples=False) assert dagbag.dags + def test_dagbag_collect_dags_stats_have_filepath_without_dag_folder(self): + with conf_vars({("core", "DAGS_FOLDER"): "/different/path"}): + dagbag = DagBag(dag_folder=TEST_DAGS_FOLDER, include_examples=False) + + assert dagbag.dagbag_stats + assert str(TEST_DAGS_FOLDER) not in dagbag.dagbag_stats[0].file + def test_dabgag_captured_warnings(self): dag_file = os.path.join(TEST_DAGS_FOLDER, "test_dag_warnings.py") dagbag = DagBag(dag_folder=dag_file, include_examples=False, collect_dags=False)