Esempio n. 1
0
def test_config():
    assert not create_app().testing
    assert create_app({'TESTING': True}).testing
    assert create_app({'STARTUP_COALESCING_SECONDS': 5}) is not None
    assert create_app({'STARTUP_COALESCING_SECONDS': 15}) is not None
    with pytest.raises(ValueError):
        create_app({'STARTUP_COALESCING_SECONDS': 4})
    with pytest.raises(ValueError):
        create_app({'STARTUP_COALESCING_SECONDS': 16})
Esempio n. 2
0
def app():
    app = create_app({
        'TESTING': True,
        'SECRET_KEY': 'testing',
        'STARTUP_COALESCING_SECONDS': 5,
    })

    yield app
Esempio n. 3
0
def app():
    db_fd, db_path = tempfile.mkstemp()

    app = create_app({
        'TESTING': True,
        'DATABASE': db_path,
    })

    with app.app_context():
        init_db()
        get_db().execute(_data_sql, multi=True)

    yield app

    os.close(db_fd)
    os.unlink(db_path)
Esempio n. 4
0
from flask import Flask
from flask_script import Manager

from homework import create_app

app = create_app()

manager = Manager(app)

if __name__ == '__main__':
    manager.run()
Esempio n. 5
0
from homework import create_app

app = create_app()

if __name__ == "__main__":
    
    app = create_app({'SHOWINFO': True})
    app.run(debug=True)
Esempio n. 6
0
def test_config():
    assert not create_app().testing
    assert create_app({'TESTING': True}).testing