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" OUTPUT_RETENTION_HOURS = 24 CLEANUP_ON_STARTUP = False CLEANUP_AFTER_DOWNLOAD = False @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()