def app(): """An application for the tests.""" _app = create_app(TestConfig) ctx = _app.test_request_context() ctx.push() yield _app ctx.pop()
from flask import Flask from DASiGraph import app if __name__ == "__main__": myapp = app.create_app("config") myapp.run(debug=True)
def test_dev_config(): """Development config.""" app = create_app(DevConfig) assert app.config['ENV'] == 'dev' assert app.config['DEBUG']
def test_production_config(): """Production config.""" app = create_app(ProdConfig) assert app.config['ENV'] == 'prod' assert not app.config['DEBUG']
def test_default_config(): app = create_app() assert app.config['ENV'] == 'prod'