예제 #1
0
def physical_db(temp_folder):
    """Setup a database in a temp folder."""
    db_path = os.path.join(temp_folder, 'store.sqlite3')
    db_uri = "sqlite:///{}".format(db_path)
    db = Brain(uri=db_uri)
    db.create_all()
    return db
예제 #2
0
def db():
    """Setup an empty database."""
    _db = Brain()
    _db.create_all()
    return _db