1

I'm trying to silence out Flask-SQLAlchemy's deprecation warning about adding overhead if used with modification tracking:

config.py file:

class BaseConfig:
    DEBUG = False
    TESTING = False
    SQLALCHEMY_DATABASE_URI = ''
    SQLALCHEMY_TRACK_MODIFICATIONS = False

class TestingConfig(BaseConfig):
    TESTING = True

test file:

from flask_testing import TestCase
from project.config import TestingConfig
from project.models import User
from project import create_app
from project import db
import unittest

app = create_app()

class TestDBsetup(TestCase):

    def create_app(self):
        app.config.from_object(TestingConfig)
        return app

    def setUp(self):
        db.create_all()

    def tearDown(self):
        db.session.remove()
        db.drop_all()

if __name__ == '__main__':
    unittest.main()

I'm still getting the famous FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning.

How can I properly silence it ?

0 Answers0