ephraimbuddy commented on a change in pull request #17347:
URL: https://github.com/apache/airflow/pull/17347#discussion_r682547231



##########
File path: tests/models/test_taskinstance.py
##########
@@ -1743,6 +1743,32 @@ def on_execute_callable(context):
         ti.refresh_from_db()
         assert ti.state == State.SUCCESS
 
+    def test_success_callback_handles_and_logs_exception(self):
+        called = completed = False
+
+        def on_success_callable(context):
+            nonlocal called, completed
+            called = True
+            raise KeyError
+            completed = True
+
+        dag = DAG(
+            'test_success_callback_handles_exception',
+            start_date=DEFAULT_DATE,
+            end_date=DEFAULT_DATE + datetime.timedelta(days=10),
+        )
+        task = DummyOperator(
+            task_id='op', email='[email protected]', 
on_success_callback=on_success_callable, dag=dag
+        )

Review comment:
       Yes. We want to change to using pytest and dag_maker. I'm already 
working on this file. You can check another one. Thanks @SamWheating 




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