def app(): app = create_app({"TESTING": True}) database = SqliteDatabase(get_db_path()) database.create_tables([Poll, Choice, VoteCast]) yield app database.drop_tables([Poll, Choice, VoteCast])
def app(): db_fd, db_path = tempfile.mkstemp() app = create_app({"TESTING": True, "DATABASE": db_path}) with app.app_context(): init_db() yield app os.close(db_fd) os.unlink(db_path)
def app(): app = create_app("testing") yield app
def test_config(): assert not create_app('production').testing assert not create_app('development').testing assert create_app('testing').testing
from poll import create_app app = create_app("production")
def app(): app = create_app('testing') return app