RODY/tests/conftest.py
552068321@qq.com 6f7de660aa first commit
2022-11-04 17:37:08 +08:00

21 lines
325 B
Python

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()