mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-22 17:04:31 +02:00
* Pass a tracer= function to Database constructor * New db.tracer() contextmanager * Neater SQL indentation, because tracer means it could be visible now * New db.execute() and db.executescript() methods Closes #150
21 lines
444 B
Python
21 lines
444 B
Python
from sqlite_utils import Database
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def fresh_db():
|
|
return Database(memory=True)
|
|
|
|
|
|
@pytest.fixture
|
|
def existing_db():
|
|
database = Database(memory=True)
|
|
database.executescript(
|
|
"""
|
|
CREATE TABLE foo (text TEXT);
|
|
INSERT INTO foo (text) values ("one");
|
|
INSERT INTO foo (text) values ("two");
|
|
INSERT INTO foo (text) values ("three");
|
|
"""
|
|
)
|
|
return database
|