uranusjr commented on code in PR #40035:
URL: https://github.com/apache/airflow/pull/40035#discussion_r1625669481


##########
tests/integration/executors/test_celery_executor.py:
##########
@@ -107,6 +110,26 @@ def teardown_method(self) -> None:
         db.clear_db_runs()
         db.clear_db_jobs()
 
+    def test_change_state_back_compat(self):
+        # This represents the old implementation that an Airflow package may 
have
+        def _change_state(self, key: TaskInstanceKey, state: 
TaskInstanceState, info=None) -> None:
+            pass
+
+        # Replace change_state function on base executor with the old version 
to force the backcompat edge
+        # case we're looking for
+        base_executor.BaseExecutor.change_state = _change_state

Review Comment:
   How about just make `change_state` on the celery executor a mock? You can do 
that with `mock.patch.object`



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to