dstandish commented on code in PR #38788:
URL: https://github.com/apache/airflow/pull/38788#discussion_r1594469896
##########
tests/models/test_taskinstance.py:
##########
@@ -1347,34 +1361,38 @@ def test_check_task_dependencies(
set_teardown, expect_state = expect_state
assert isinstance(set_teardown, bool)
- monkeypatch.setattr(_UpstreamTIStates, "calculate", lambda *_:
upstream_states)
-
# sanity checks
- s = upstream_states
- assert s.skipped >= s.skipped_setup
- assert s.success >= s.success_setup
- assert s.done == s.failed + s.success + s.removed + s.upstream_failed
+ s.skipped
+ assert len(upstream_states) == upstream_setups + 5
with dag_maker() as dag:
downstream = EmptyOperator(task_id="downstream",
trigger_rule=trigger_rule)
if set_teardown:
downstream.as_teardown()
+ work_tasks = []
for i in range(5):
task = EmptyOperator(task_id=f"work_{i}", dag=dag)
task.set_downstream(downstream)
+ work_tasks.append(task)
for i in range(upstream_setups):
task = EmptyOperator(task_id=f"setup_{i}", dag=dag).as_setup()
- task.set_downstream(downstream)
+ task.set_downstream(work_tasks)
Review Comment:
i don't understand. it might be best to make a separate PR for your test
refactor without simultaneously changing the code. then followup with the real
code change (and the test changes required just for that will be easier to see)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]