Exemple #1
0
def db(app):
    _db.app = app
    with app.app_context():
        _db.create_all()

    yield _db

    _db.drop_all()
def db(app):
    _db.app = app
    with app.app_context():
        _db.create_all()

    yield _db

    _db.drop_all()
Exemple #3
0
def app():
    os.makedirs(config.STORAGE_CONTAINER)
    _app = create_app(config)
    with _app.app_context():
        _db.create_all()
    ctx = _app.test_request_context()
    ctx.push()

    yield _app

    _db.drop_all()
    shutil.rmtree(config.STORAGE_CONTAINER)
    ctx.pop()
def app():
    os.makedirs(config.STORAGE_CONTAINER)
    _app = create_app(config)
    with _app.app_context():
        _db.create_all()
    ctx = _app.test_request_context()
    ctx.push()

    yield _app

    _db.drop_all()
    shutil.rmtree(config.STORAGE_CONTAINER)
    ctx.pop()