def test_raise(self, local_connection):
    connection = local_connection
    users = self.tables.users
    transaction = connection.begin()
    try:
        connection.execute(users.insert(), user_id=1, user_name='user1')
        connection.execute(users.insert(), user_id=2, user_name='user2')
        connection.execute(users.insert(), user_id=1, user_name='user3')
        transaction.commit()
        assert False
    except Exception as e:
        print('Exception: ', e)
        transaction.rollback()
    result = connection.exec_driver_sql('select * from users')
    assert (len(result.fetchall()) == 0)
def test_raise(self, local_connection):
    connection = local_connection
    users = self.tables.users
    transaction = connection.begin()
    try:
        connection.execute(users.insert(), user_id=1, user_name='user1')
        connection.execute(users.insert(), user_id=2, user_name='user2')
        connection.execute(users.insert(), user_id=1, user_name='user3')
        transaction.commit()
        assert False
    except Exception as e:
        print('Exception: ', e)
        transaction.rollback()
    result = connection.exec_driver_sql('select * from users')
    assert (len(result.fetchall()) == 0)