Skip to content

Commit

Permalink
[feat]: modify test for not checking Variable
Browse files Browse the repository at this point in the history
  • Loading branch information
srlee056 committed Mar 4, 2024
1 parent 942ae2d commit 6964eac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/dags/test_dag_integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import glob
import os
import pytest
from unittest.mock import patch

# from airflow.models import DAG
from airflow.models.dagbag import DagBag
Expand All @@ -21,11 +22,10 @@ def test_dag_integrity(dag_file):
Args:
dag_file (str): The path to a DAG file to be tested.
"""
dag_bag = DagBag(dag_folder=os.path.dirname(dag_file), include_examples=False)
with patch("airflow.models.Variable.get", return_value="dummy_value"):
dag_bag = DagBag(dag_folder=os.path.dirname(dag_file), include_examples=False)
dag_bag.process_file(dag_file, only_if_updated=True)

dag_bag.process_file(dag_file, only_if_updated=True)

# dag_id, dag in dag_bag.dags.items()
for dag_id, _ in dag_bag.dags.items():
assert dag_id in dag_bag.dags, "DAG ID not found in dag_bag.dags"
assert not dag_bag.import_errors, "Import errors found in DagBag"
for dag_id, _ in dag_bag.dags.items():
assert dag_id in dag_bag.dags, "DAG ID not found in dag_bag.dags"
assert not dag_bag.import_errors, "Import errors found in DagBag"

0 comments on commit 6964eac

Please sign in to comment.