Files
app-autotest/tests/conftest.py
T

20 lines
418 B
Python

from pathlib import Path
import sys
import pytest
# Make `site/` importable as top-level modules: app, routes, db, operations, ...
SITE_DIR = Path(__file__).resolve().parents[1] / "site"
if str(SITE_DIR) not in sys.path:
sys.path.insert(0, str(SITE_DIR))
@pytest.fixture
def app_client():
from app import app
app.config.update(TESTING=True)
with app.test_client() as client:
yield client