def test_commits(self, local_connection):
    users = self.tables.users
    connection = local_connection
    transaction = connection.begin()
    connection.execute(users.insert(), user_id=1, user_name='user1')
    transaction.commit()
    transaction = connection.begin()
    connection.execute(users.insert(), user_id=2, user_name='user2')
    connection.execute(users.insert(), user_id=3, user_name='user3')
    transaction.commit()
    transaction = connection.begin()
    result = connection.exec_driver_sql('select * from users')
    assert (len(result.fetchall()) == 3)
    transaction.commit()
    connection.close()
def test_commits(self, local_connection):
    users = self.tables.users
    connection = local_connection
    transaction = connection.begin()
    connection.execute(users.insert(), user_id=1, user_name='user1')
    transaction.commit()
    transaction = connection.begin()
    connection.execute(users.insert(), user_id=2, user_name='user2')
    connection.execute(users.insert(), user_id=3, user_name='user3')
    transaction.commit()
    transaction = connection.begin()
    result = connection.exec_driver_sql('select * from users')
    assert (len(result.fetchall()) == 3)
    transaction.commit()
    connection.close()