

def test_query_table_with_sqlite3_connection(self):
    database_file = 'sometable.db'
    db = Database(sqlite3.connect(database_file))
    db.open()
    db.execute('CREATE TABLE IF NOT EXISTS SomeTable (id VARCHAR(255))')
    db.execute('INSERT INTO SomeTable VALUES (1)')
    db.execute('INSERT INTO SomeTable VALUES (?)', (2,))
    db.execute('SELECT * FROM SomeTable')
    rows = db.fetchall()
    self.assertEqual(True, isinstance(rows, types.GeneratorType))
    self.assertEqual(['1', '2'], [row[0] for row in rows])
    db.rollback()
    db.close()
    os.remove(database_file)

dataset/ETHPy150Open Dwolla/arbalest/integration/test_database.py DatabaseShould.test_query_table_with_sqlite3_connection/original