flask-practice/tests/conftest.py
2022-03-09 17:09:56 +00:00

26 lines
374 B
Python

import os
import tempfile
import pytest
from app import create_app
@pytest.fixture
def app():
app = create_app({
'TESTING': True,
'DATABASE': ':memory:',
})
with app.app_context():
pass
yield app
@pytest.fixture
def client(app):
return app.test_client()
@pytest.fixture
def runner(app):
return app.test_cli_runner()