SamWheating commented on a change in pull request #17347: URL: https://github.com/apache/airflow/pull/17347#discussion_r681810429
########## 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='t...@test.test', on_success_callback=on_success_callable, dag=dag + ) Review comment: Ok, is the plan to stop using `unittest` everywhere? I don't mind refactoring the tests in this file, but I'd rather do it in a separate PR. -- 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