Commit cfb7f99c by Sarina Canelake Committed by Diana Huang

Add filter to ignore deprecation warnings by default

Add filter to only show first occurance of DepWarning
parent df1a9304
...@@ -33,6 +33,7 @@ from lms.envs.common import ( ...@@ -33,6 +33,7 @@ from lms.envs.common import (
USE_TZ, TECH_SUPPORT_EMAIL, PLATFORM_NAME, BUGS_EMAIL, DOC_STORE_CONFIG, ALL_LANGUAGES, WIKI_ENABLED, MODULESTORE USE_TZ, TECH_SUPPORT_EMAIL, PLATFORM_NAME, BUGS_EMAIL, DOC_STORE_CONFIG, ALL_LANGUAGES, WIKI_ENABLED, MODULESTORE
) )
from path import path from path import path
from warnings import simplefilter
from lms.envs.modulestore_settings import * from lms.envs.modulestore_settings import *
from lms.lib.xblock.mixin import LmsBlockMixin from lms.lib.xblock.mixin import LmsBlockMixin
...@@ -182,6 +183,10 @@ XQUEUE_INTERFACE = { ...@@ -182,6 +183,10 @@ XQUEUE_INTERFACE = {
'basic_auth': None, 'basic_auth': None,
} }
################################# Deprecation warnings #####################
# Ignore deprecation warnings (so we don't clutter Jenkins builds/production)
simplefilter('ignore')
################################# Middleware ################################### ################################# Middleware ###################################
# List of finder classes that know how to find static files in # List of finder classes that know how to find static files in
......
...@@ -15,7 +15,7 @@ sessions. Assumes structure: ...@@ -15,7 +15,7 @@ sessions. Assumes structure:
from .common import * from .common import *
import os import os
from path import path from path import path
from warnings import filterwarnings from warnings import filterwarnings, simplefilter
from uuid import uuid4 from uuid import uuid4
# import settings from LMS for consistent behavior with CMS # import settings from LMS for consistent behavior with CMS
...@@ -149,6 +149,10 @@ INSTALLED_APPS += ('external_auth', ) ...@@ -149,6 +149,10 @@ INSTALLED_APPS += ('external_auth', )
# hide ratelimit warnings while running tests # hide ratelimit warnings while running tests
filterwarnings('ignore', message='No request passed to the backend, unable to rate-limit') filterwarnings('ignore', message='No request passed to the backend, unable to rate-limit')
# Ignore deprecation warnings (so we don't clutter Jenkins builds/production)
# https://docs.python.org/2/library/warnings.html#the-warnings-filter
simplefilter('ignore') # Change to "default" to see the first instance of each hit
# or "error" to convert all into errors
################################# CELERY ###################################### ################################# CELERY ######################################
......
...@@ -30,6 +30,7 @@ import imp ...@@ -30,6 +30,7 @@ import imp
import json import json
from path import path from path import path
from warnings import simplefilter
from .discussionsettings import * from .discussionsettings import *
from .modulestore_settings import * from .modulestore_settings import *
...@@ -760,9 +761,14 @@ MOCK_PEER_GRADING = False ...@@ -760,9 +761,14 @@ MOCK_PEER_GRADING = False
# Used for testing, debugging staff grading # Used for testing, debugging staff grading
MOCK_STAFF_GRADING = False MOCK_STAFF_GRADING = False
################################# Jasmine ################################### ################################# Jasmine ##################################
JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee' JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee'
################################# Deprecation warnings #####################
# Ignore deprecation warnings (so we don't clutter Jenkins builds/production)
simplefilter('ignore')
################################# Waffle ################################### ################################# Waffle ###################################
# Name prepended to cookies set by Waffle # Name prepended to cookies set by Waffle
......
...@@ -15,7 +15,7 @@ sessions. Assumes structure: ...@@ -15,7 +15,7 @@ sessions. Assumes structure:
from .common import * from .common import *
import os import os
from path import path from path import path
from warnings import filterwarnings from warnings import filterwarnings, simplefilter
from uuid import uuid4 from uuid import uuid4
os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = 'localhost:8000-9000' os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = 'localhost:8000-9000'
...@@ -179,6 +179,11 @@ SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd' ...@@ -179,6 +179,11 @@ SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd'
# hide ratelimit warnings while running tests # hide ratelimit warnings while running tests
filterwarnings('ignore', message='No request passed to the backend, unable to rate-limit') filterwarnings('ignore', message='No request passed to the backend, unable to rate-limit')
# Ignore deprecation warnings (so we don't clutter Jenkins builds/production)
# https://docs.python.org/2/library/warnings.html#the-warnings-filter
simplefilter('ignore') # Change to "default" to see the first instance of each hit
# or "error" to convert all into errors
######### Third-party auth ########## ######### Third-party auth ##########
FEATURES['ENABLE_THIRD_PARTY_AUTH'] = True FEATURES['ENABLE_THIRD_PARTY_AUTH'] = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment