diff --git a/flask_sqlalchemy/__init__.py b/flask_sqlalchemy/__init__.py index 22941de6..2b110d5e 100644 --- a/flask_sqlalchemy/__init__.py +++ b/flask_sqlalchemy/__init__.py @@ -457,11 +457,11 @@ def __get__(self, obj, type): def _record_queries(app): - if app.debug: - return True rq = app.config['SQLALCHEMY_RECORD_QUERIES'] if rq is not None: return rq + if app.debug: + return True return bool(app.config.get('TESTING'))