Skip to content

Commit 53e8254

Browse files
committed
Fix pytests
1 parent bb58835 commit 53e8254

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

airflow-core/tests/unit/jobs/test_scheduler_job.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4634,6 +4634,7 @@ def test_max_active_runs_in_a_dag_doesnt_prevent_backfill_from_running_catchup_t
46344634
to_date=to_date,
46354635
max_active_runs=3,
46364636
reverse=False,
4637+
triggering_user="test_user",
46374638
dag_run_conf={},
46384639
)
46394640
dag1_running_count = (
@@ -4738,6 +4739,7 @@ def test_max_active_runs_in_a_dag_doesnt_prevent_backfill_from_running_catchup_f
47384739
to_date=to_date,
47394740
max_active_runs=3,
47404741
reverse=False,
4742+
triggering_user="test_user",
47414743
dag_run_conf={},
47424744
)
47434745

@@ -4813,6 +4815,7 @@ def _running_counts():
48134815
to_date=to_date,
48144816
max_active_runs=3,
48154817
reverse=False,
4818+
triggering_user="test_user",
48164819
dag_run_conf={},
48174820
)
48184821
dag1_non_b_running, dag1_b_running, total_running = _running_counts()
@@ -4928,6 +4931,7 @@ def _running_counts():
49284931
to_date=to_date,
49294932
max_active_runs=3,
49304933
reverse=False,
4934+
triggering_user="test_user",
49314935
dag_run_conf={},
49324936
)
49334937
dag1_non_b_running, dag1_b_running, total_running = _running_counts()
@@ -5034,6 +5038,7 @@ def _running_counts():
50345038
to_date=to_date,
50355039
max_active_runs=3,
50365040
reverse=False,
5041+
triggering_user="test_user",
50375042
dag_run_conf={},
50385043
)
50395044
dag1_non_b_running, dag1_b_running, total_running = _running_counts()
@@ -5182,6 +5187,7 @@ def _running_counts():
51825187
to_date=to_date,
51835188
max_active_runs=3,
51845189
reverse=False,
5190+
triggering_user="test_user",
51855191
dag_run_conf={},
51865192
)
51875193
dag1_non_b_running, dag1_b_running, total_running = _running_counts()
@@ -6654,6 +6660,7 @@ def test_mark_backfills_completed(dag_maker, session):
66546660
to_date=pendulum.parse("2021-01-03"),
66556661
max_active_runs=10,
66566662
reverse=False,
6663+
triggering_user="test_user",
66576664
dag_run_conf={},
66586665
)
66596666
session.expunge_all()

airflow-core/tests/unit/models/test_backfill.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def test_reverse_and_depends_on_past_fails(dep_on_past, dag_maker, session):
8888
to_date=pendulum.parse("2021-01-05"),
8989
max_active_runs=2,
9090
reverse=True,
91+
triggering_user="pytest",
9192
dag_run_conf={},
9293
)
9394
if dep_on_past:
@@ -124,6 +125,7 @@ def test_create_backfill_simple(reverse, existing, dag_maker, session):
124125
to_date=pendulum.parse("2021-01-05"),
125126
max_active_runs=2,
126127
reverse=reverse,
128+
triggering_user="pytest",
127129
dag_run_conf=expected_run_conf,
128130
)
129131
query = (
@@ -189,6 +191,7 @@ def test_create_backfill_clear_existing_bundle_version(dag_maker, session):
189191
max_active_runs=10,
190192
reverse=False,
191193
dag_run_conf=None,
194+
triggering_user="pytest",
192195
reprocess_behavior=ReprocessBehavior.FAILED,
193196
)
194197
session.commit()
@@ -277,6 +280,7 @@ def test_reprocess_behavior(reprocess_behavior, num_in_b, exc_reasons, dag_maker
277280
max_active_runs=2,
278281
reprocess_behavior=reprocess_behavior,
279282
reverse=False,
283+
triggering_user="pytest",
280284
dag_run_conf=None,
281285
)
282286

@@ -318,6 +322,7 @@ def test_params_stored_correctly(dag_maker, session):
318322
to_date=pendulum.parse("2021-01-05"),
319323
max_active_runs=263,
320324
reverse=False,
325+
triggering_user="pytest",
321326
dag_run_conf={"this": "param"},
322327
)
323328
session.expunge_all()
@@ -343,6 +348,7 @@ def test_active_dag_run(dag_maker, session):
343348
to_date=pendulum.parse("2021-01-05"),
344349
max_active_runs=10,
345350
reverse=False,
351+
triggering_user="pytest",
346352
dag_run_conf={"this": "param"},
347353
)
348354
assert b1 is not None
@@ -353,6 +359,7 @@ def test_active_dag_run(dag_maker, session):
353359
to_date=pendulum.parse("2021-02-05"),
354360
max_active_runs=10,
355361
reverse=False,
362+
triggering_user="pytest",
356363
dag_run_conf={"this": "param"},
357364
)
358365

@@ -483,5 +490,6 @@ def test_depends_on_past_requires_reprocess_failed(dep_on_past, behavior, dag_ma
483490
max_active_runs=5,
484491
reverse=False,
485492
dag_run_conf={},
493+
triggering_user="pytest",
486494
reprocess_behavior=behavior,
487495
)

0 commit comments

Comments
 (0)