27 lines
504 B
Python
27 lines
504 B
Python
import shutil
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from app import create_app
|
|
|
|
|
|
class TestConfig:
|
|
TESTING = True
|
|
SECRET_KEY = "test-secret"
|
|
MAX_CONTENT_LENGTH = 100 * 1024 * 1024
|
|
PREVIEW_RECORD_LIMIT = 5
|
|
OUTPUT_DIRECTORY = "test-outputs"
|
|
|
|
|
|
@pytest.fixture()
|
|
def app():
|
|
flask_app = create_app(TestConfig)
|
|
yield flask_app
|
|
shutil.rmtree(Path(flask_app.instance_path) / "test-outputs", ignore_errors=True)
|
|
|
|
|
|
@pytest.fixture()
|
|
def client(app):
|
|
return app.test_client()
|