Skip to content

Commit

Permalink
Init db before tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ifoukarakis committed Dec 14, 2023
1 parent 1606eab commit 032dbb9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions airflow/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from airflow.models import BaseOperator
from airflow.utils.state import DagRunState
from airflow.utils.types import DagRunType
from uuid import uuid4
from airflow.utils import db

@pytest.fixture(autouse=True)
def config_utils(monkeypatch):
Expand All @@ -24,8 +24,14 @@ def config_utils(monkeypatch):
monkeypatch.setenv("AIRFLOW_VAR_RUDDER_MAX_AGE", '2')


@pytest.fixture(scope="session")
def init_db():
db.initdb()
db.resetdb()


@pytest.fixture
def config_alert_context(mocker):
def config_alert_context(mocker, init_db):
"""
Mocks airflow context passed as callback function parameter.
Dict contains only required keys used in the function.
Expand Down

0 comments on commit 032dbb9

Please sign in to comment.