diff options
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/migrations/env.py (renamed from migrations/env.py) | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/migrations/env.py b/webmentions_ssg/migrations/env.py index fa912c3..e2e0ec9 100644 --- a/migrations/env.py +++ b/webmentions_ssg/migrations/env.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: BSD-3-Clause import logging -from logging.config import fileConfig from alembic import context from flask import current_app @@ -12,19 +11,14 @@ from flask import current_app # access to the values within the .ini file in use. config = context.config -# Interpret the config file for Python logging. -# This line sets up loggers basically. -fileConfig(config.config_file_name) +# Flask already configures application logging. +# Do not let Alembic replace existing logging handlers, +# including pytest's log capture handler. logger = logging.getLogger("alembic.env") def get_engine(): - try: - # this works with Flask-SQLAlchemy<3 and Alchemical - return current_app.extensions["migrate"].db.get_engine() - except TypeError, AttributeError: - # this works with Flask-SQLAlchemy>=3 - return current_app.extensions["migrate"].db.engine + return current_app.extensions["migrate"].db.engine def get_engine_url(): |
