syedahsn commented on code in PR #40030:
URL: https://github.com/apache/airflow/pull/40030#discussion_r1632090597


##########
tests/models/test_dag.py:
##########
@@ -2623,6 +2624,29 @@ def test_replace_outdated_access_control_actions(self):
             dag.access_control = outdated_permissions
         assert dag.access_control == updated_permissions
 
+    def test_validate_executor_field_executor_not_configured(self):
+        dag = DAG(
+            "test-dag",
+            schedule=None,
+        )
+
+        EmptyOperator(task_id="t1", dag=dag, executor="test.custom.executor")
+        with pytest.raises(
+            ValueError, match="The specified executor test.custom.executor for 
task t1 is not configured"
+        ):
+            dag.validate()
+
+    def test_validate_executor_field(self):
+        with patch.object(ExecutorLoader, "lookup_executor_name_by_str") as 
mock_get_executor_names:
+            dag = DAG(
+                "test-dag",
+                schedule=None,
+            )
+
+            mock_get_executor_names.return_value = None

Review Comment:
   Yep, you're correct. Made the change. Thanks!



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