flask-practice/tests/conftest.py

26 lines
374 B
Python
Raw Permalink Normal View History

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