PLAT-1858 Better capture of deprecation warnings

This commit is contained in:
Jeremy Bowman
2017-12-14 14:30:40 -05:00
parent 6388391da6
commit b26fe5fd24
12 changed files with 58 additions and 30 deletions

View File

@@ -21,7 +21,6 @@ sessions. Assumes structure:
from .common import *
import os
from path import Path as path
from warnings import filterwarnings, simplefilter
from uuid import uuid4
from util.db import NoOpMigrationModules
from openedx.core.lib.derived import derive_settings
@@ -175,15 +174,6 @@ CACHES = {
},
}
# hide ratelimit warnings while running tests
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
# Change to "default" to see the first instance of each hit
# or "error" to convert all into errors
simplefilter('ignore')
################################# CELERY ######################################
CELERY_ALWAYS_EAGER = True

View File

@@ -1,6 +1,11 @@
[pytest]
DJANGO_SETTINGS_MODULE = cms.envs.test
addopts = --nomigrations --reuse-db --durations=20 -p no:randomly
# Enable default handling for all warnings, including those that are ignored by default;
# but hide rate-limit warnings, because we deliberately don't throttle test user logins
filterwarnings =
default
ignore:No request passed to the backend, unable to rate-limit.*:UserWarning
norecursedirs = envs
python_classes =
python_files = tests.py test_*.py *_tests.py