Disables logging during testing.
This commit is contained in:
Родитель
852ce2eb7c
Коммит
7330bddf71
|
@ -13,7 +13,8 @@ case "$1" in
|
|||
test)
|
||||
echo "Running Tests"
|
||||
cd ..
|
||||
flake8 . --exclude=./recommendation/views/data/dummy.py && nosetests
|
||||
flake8 . --exclude=./recommendation/views/data/dummy.py
|
||||
RECOMMENDATION_TESTING=true nosetests
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {web|worker|test}"
|
||||
|
|
|
@ -2,6 +2,8 @@ from os import environ as env
|
|||
|
||||
|
||||
DEBUG = env.get('RECOMMENDATION_ENV', 'development') == 'development'
|
||||
TESTING = env.get('RECOMMENDATION_TESTING', None) == 'true'
|
||||
|
||||
KEY_PREFIX = env.get('RECOMMENDATION_KEY_PREFIX', 'query_')
|
||||
|
||||
CACHE_TTL = env.get('RECOMMENDATION_CACHE_TTL', 7 * 24 * 60 * 60)
|
||||
|
|
|
@ -37,6 +37,7 @@ def create_app():
|
|||
app.logger.setLevel(INFO)
|
||||
|
||||
# Use logging middleware.
|
||||
if not conf.TESTING:
|
||||
app.before_request(request_timer)
|
||||
app.after_request(request_summary)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче