def go():
    with mock.patch.object(connection, '_commit_impl', mock.Mock(side_effect=exc.DBAPIError('failure', None, None, None))):
        with connection.begin() as t1:
            transaction[0] = t1
def go():
    with mock.patch.object(connection, '_commit_impl', mock.Mock(side_effect=exc.DBAPIError('failure', None, None, None))):
        with connection.begin() as t1:
            transaction[0] = t1