diff --git a/tests/test_example_dags.py b/tests/test_example_dags.py index 63abca541c..41b967e921 100644 --- a/tests/test_example_dags.py +++ b/tests/test_example_dags.py @@ -1,6 +1,7 @@ from __future__ import annotations from pathlib import Path +from functools import cache import airflow import pytest @@ -37,6 +38,7 @@ def session(): return get_session() +@cache def get_dag_bag() -> DagBag: """Create a DagBag by adding the files that are not supported to .airflowignore""" with open(AIRFLOW_IGNORE_FILE, "w+") as file: diff --git a/tests/test_example_dags_no_connections.py b/tests/test_example_dags_no_connections.py index 7048b1b0eb..97f39bf991 100644 --- a/tests/test_example_dags_no_connections.py +++ b/tests/test_example_dags_no_connections.py @@ -1,6 +1,7 @@ from __future__ import annotations from pathlib import Path +from functools import cache import airflow import pytest @@ -23,6 +24,7 @@ } +@cache def get_dag_bag() -> DagBag: """Create a DagBag by adding the files that are not supported to .airflowignore""" with open(AIRFLOW_IGNORE_FILE, "w+") as file: