ReadytoRocc commented on a change in pull request #19194:
URL: https://github.com/apache/airflow/pull/19194#discussion_r779689744



##########
File path: tests/models/test_taskinstance.py
##########
@@ -537,10 +519,10 @@ def reschedule():
         session.commit()
 
         ti.task = task
-        if state in [State.FAILED, State.UP_FOR_RETRY]:
+        if exception_type == AirflowException:

Review comment:
       Thanks for the feedback, I will rename `exception_type` to `exception`. 
I will edit as follows:
   
   ```
   if state in [State.FAILED, State.UP_FOR_RETRY]:
       with pytest.raises(exception):
           ti.run()
   else:
       ti.run()
   ```
   
   This ensures that the `exception` is tied to whatever `state` is being 
checked. 
   
   The reason I did not include `AirflowRescheduleException(timezone.utcnow())` 
is because that exception is caught during `ti.run()`.




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