vergunningzoeker-6d29fc0a/tests/conftest.py

16 lines
367 B
Python

import os
os.environ["DATABASE_URL"] = "sqlite:///test.db"
import pytest
from app import create_app
from app.database import Base, engine
@pytest.fixture
def client():
app = create_app()
app.config["TESTING"] = True
Base.metadata.create_all(bind=engine)
with app.test_client() as client:
yield client
Base.metadata.drop_all(bind=engine)