

@mock.patch.object(notifier.LOG, 'warn')
def test_update_progress_handler_failure(self, mocked_warn):

    def progress_callback(*args, **kwargs):
        raise Exception('Woot!')
    a_task = ProgressTask()
    a_task.notifier.register(task.EVENT_UPDATE_PROGRESS, progress_callback)
    a_task.execute([0.5])
    self.assertEqual(1, mocked_warn.call_count)

dataset/ETHPy150Open openstack/taskflow/taskflow/tests/unit/test_task.py TaskTest.test_update_progress_handler_failure/original