CICD/app/test/fixtures.py

24 lines
338 B
Python
Raw Normal View History

2019-05-18 17:22:18 +02:00
import pytest
from fte import create_app
@pytest.fixture
def app():
return create_app('test')
@pytest.fixture
def client(app):
return app.test_client()
@pytest.fixture
def db(app):
from fte import db
with app.app_context():
db.create_all()
yield db
db.drop_all()
db.session.commit()