summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-01-13 19:02:39 -0500
committerTim Graham <timograham@gmail.com>2016-01-14 09:05:43 -0500
commit5b94b17feff15a9f0345f92fc0568bfe7038e3a3 (patch)
treec1dba0a0e0a3eba2ed687e04187dc4b70cae10a6 /django
parent28acc0d6df844ccfc8de6f4e7d5883eb4841e946 (diff)
Fixed #25999 -- Removed promotion of RemovedInNextVersionWarning to loud by default.
Diffstat (limited to 'django')
-rw-r--r--django/core/management/commands/test.py16
-rw-r--r--django/utils/log.py13
2 files changed, 0 insertions, 29 deletions
diff --git a/django/core/management/commands/test.py b/django/core/management/commands/test.py
index 6fdaca944c..b02c105261 100644
--- a/django/core/management/commands/test.py
+++ b/django/core/management/commands/test.py
@@ -1,4 +1,3 @@
-import logging
import os
import sys
@@ -54,21 +53,6 @@ class Command(BaseCommand):
if hasattr(test_runner_class, 'add_arguments'):
test_runner_class.add_arguments(parser)
- def execute(self, *args, **options):
- if options['verbosity'] > 0:
- # ensure that deprecation warnings are displayed during testing
- # the following state is assumed:
- # logging.capturewarnings is true
- # a "default" level warnings filter has been added for
- # DeprecationWarning. See django.conf.LazySettings._configure_logging
- logger = logging.getLogger('py.warnings')
- handler = logging.StreamHandler()
- logger.addHandler(handler)
- super(Command, self).execute(*args, **options)
- if options['verbosity'] > 0:
- # remove the testing-specific handler
- logger.removeHandler(handler)
-
def handle(self, *test_labels, **options):
from django.conf import settings
from django.test.utils import get_runner
diff --git a/django/utils/log.py b/django/utils/log.py
index fcc7575180..cc15dfa636 100644
--- a/django/utils/log.py
+++ b/django/utils/log.py
@@ -2,15 +2,12 @@ from __future__ import unicode_literals
import logging
import logging.config # needed when logging_config doesn't start with logging.config
-import sys
-import warnings
from copy import copy
from django.conf import settings
from django.core import mail
from django.core.mail import get_connection
from django.core.management.color import color_style
-from django.utils.deprecation import RemovedInNextVersionWarning
from django.utils.module_loading import import_string
from django.views.debug import ExceptionReporter
@@ -62,21 +59,11 @@ DEFAULT_LOGGING = {
'level': 'INFO',
'propagate': False,
},
- 'py.warnings': {
- 'handlers': ['console'],
- },
}
}
def configure_logging(logging_config, logging_settings):
- if not sys.warnoptions:
- # Route warnings through python logging
- logging.captureWarnings(True)
- # RemovedInNextVersionWarning is a subclass of DeprecationWarning which
- # is hidden by default, hence we force the "default" behavior
- warnings.simplefilter("default", RemovedInNextVersionWarning)
-
if logging_config:
# First find the logging configuration function ...
logging_config_func = import_string(logging_config)