Esempio n. 1
0
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()
Esempio n. 2
0
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()
Esempio n. 3
0
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)
Esempio n. 4
0
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)
Esempio n. 5
0
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()
Esempio n. 6
0
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)