jedcunningham commented on code in PR #39351:
URL: https://github.com/apache/airflow/pull/39351#discussion_r1586522534


##########
tests/sensors/test_base.py:
##########
@@ -284,62 +284,59 @@ def test_ok_with_reschedule(self, make_sensor, 
time_machine, task_reschedules_fo
             if ti.task_id == DUMMY_OP:
                 assert ti.state == State.NONE
 
-    def test_fail_with_reschedule(self, make_sensor, time_machine):
+    def test_fail_with_reschedule(self, make_sensor, time_machine, session):
         sensor, dr = make_sensor(return_value=False, poke_interval=10, 
timeout=5, mode="reschedule")
 
+        def _get_tis():
+            tis = dr.get_task_instances(session=session)
+            yield next(x for x in tis if x.task_id == SENSOR_OP)

Review Comment:
   Could probably DRY this up a bit and pass in the task_ids you want yielded, 
then you could reuse the helper for all of these tests.



-- 
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]

Reply via email to