20 lines
498 B
Python
20 lines
498 B
Python
"""Общие хелперы для автотестов WESP."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Type
|
|
|
|
from flask import Flask
|
|
|
|
from app import create_app
|
|
from config import TestingConfig
|
|
|
|
|
|
def create_test_app(
|
|
config_class: Type = TestingConfig,
|
|
*,
|
|
run_migrations: bool = False,
|
|
) -> Flask:
|
|
"""Flask app для тестов (по умолчанию TestingConfig + bypass setup guard)."""
|
|
return create_app(config_class, run_migrations=run_migrations)
|