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