def db(): config = {'SQL_DATABASE_URI': 'sqlite://', 'SQL_ECHO': False} _db = SQLClient(config, model_class=Model) _db.create_all() yield _db _db.disconnect() _db.drop_all()
def db(): config = {"SQL_DATABASE_URI": "sqlite://", "SQL_ECHO": False} _db = SQLClient(config, model_class=Model) _db.create_all() yield _db _db.disconnect() _db.drop_all()
def filedb(tmpdir): dbpath = str(tmpdir.mkdir(random_alpha()).join('file.db')) config = {'SQL_DATABASE_URI': 'sqlite:///{0}'.format(dbpath)} _filedb = SQLClient(config, model_class=Model) _filedb.create_all() yield _filedb _filedb.disconnect() os.remove(dbpath)
def filedb(tmpdir): dbpath = str(tmpdir.mkdir(random_alpha()).join("file.db")) config = {"SQL_DATABASE_URI": f"sqlite:///{dbpath}"} _filedb = SQLClient(config, model_class=Model) _filedb.create_all() yield _filedb _filedb.disconnect() os.remove(dbpath)
def db(): config = { 'SQL_DATABASE_URI': 'sqlite://', 'SQL_ECHO': False } _db = SQLClient(config, model_class=Model) _db.create_all() yield _db _db.disconnect() _db.drop_all()
def filedb(tmpdir): dbpath = str(tmpdir.mkdir(random_alpha()).join('file.db')) config = { 'SQL_DATABASE_URI': 'sqlite:///{0}'.format(dbpath) } _filedb = SQLClient(config, model_class=Model) _filedb.create_all() yield _filedb _filedb.disconnect() os.remove(dbpath)