rifalto/test/conftest.py

17 lines
352 B
Python
Raw Normal View History

2023-06-14 09:20:36 -03:00
import pytest
from rifaserver.app import create_app
from rifaserver.models import db as _db
@pytest.fixture(scope='module')
def test_app():
app = create_app('testing')
with app.app_context():
yield app
@pytest.fixture(scope='module')
def test_db(test_app):
_db.app = test_app
_db.create_all()
yield _db
_db.drop_all()