nailo2c commented on code in PR #60734:
URL: https://github.com/apache/airflow/pull/60734#discussion_r2742748756


##########
airflow-core/tests/unit/dag_processing/test_processor.py:
##########
@@ -666,6 +667,32 @@ def test_import_error_updates_timestamps(session):
     assert stat.import_errors == 1
 
 
+class TestExecuteCallbacks:
+    def test_execute_callbacks_locks_bundle_version(self):
+        request = DagCallbackRequest(
+            filepath="test.py",
+            dag_id="test_dag",
+            run_id="test_run",
+            bundle_name="testing",
+            bundle_version="some_commit_hash",
+            is_failure_callback=False,
+            msg=None,
+        )
+        log = structlog.get_logger()
+        dagbag = MagicMock()
+
+        with (
+            patch("airflow.dag_processing.processor.BundleVersionLock") as 
mock_lock,
+            patch("airflow.dag_processing.processor._execute_dag_callbacks") 
as mock_execute,
+        ):
+            _execute_callbacks(dagbag, [request], log)

Review Comment:
   Thanks, I'll apply this change and update 
`mock_execute.assert_called_once_with(...)` accordingly (use `callbacks[0]` 
instead of `request`).



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