uranusjr commented on code in PR #40035: URL: https://github.com/apache/airflow/pull/40035#discussion_r1627169803
########## 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: You can use `side_effect` to still call the actual implementation while recording the call count. I don’t have a preference though, just adding possibilities if you’re looking for alternatives. -- 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