Enable deprecation warnings in dev environment (including SQLAlchemy 2.0 warnings)
This commit is contained in:
parent
04d434b4a3
commit
4b9d973f40
|
|
@ -1,3 +1,6 @@
|
||||||
FLASK_APP=tofu_api.app
|
FLASK_APP=tofu_api.app
|
||||||
FLASK_ENV=development
|
FLASK_ENV=development
|
||||||
FLASK_CONFIG_FILE=config.dev.yml
|
FLASK_CONFIG_FILE=config.dev.yml
|
||||||
|
|
||||||
|
# Show SQLAlchemy 2.0 deprecation warnings
|
||||||
|
SQLALCHEMY_WARN_20=1
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
import warnings
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
|
|
||||||
|
|
@ -6,6 +8,10 @@ from tofu_api.api import TofuApiBlueprint
|
||||||
from tofu_api.common.config import Config
|
from tofu_api.common.config import Config
|
||||||
from tofu_api.dependencies import Dependencies
|
from tofu_api.dependencies import Dependencies
|
||||||
|
|
||||||
|
# Enable deprecation warnings in dev environment
|
||||||
|
if not sys.warnoptions and os.getenv('FLASK_ENV') == 'development':
|
||||||
|
warnings.filterwarnings('default', module='tofu_api.*')
|
||||||
|
|
||||||
|
|
||||||
class App(Flask):
|
class App(Flask):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue