RODY/tests/conftest.py

21 lines
325 B
Python
Raw Normal View History

2022-11-04 17:37:08 +08:00
import pytest
from app.run import app as tapp
@pytest.fixture(scope='session')
def app(request):
ctx = tapp.app_context()
ctx.push()
def teardown():
ctx.pop()
request.addfinalizer(teardown)
return tapp
@pytest.fixture(scope='session')
def client(app, request):
return app.test_client()