mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
[1.5.x] Fixed #18985 -- ensure module level deprecations are displayed
Also don't compete with -W CLI option.
Thanks to Aymeric Augustin for the catch, and Claude Paroz for the patch.
Backport of e79b857a07 from master.
This commit is contained in:
committed by
Jacob Kaplan-Moss
parent
456d6c15db
commit
572a300e56
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
@@ -106,6 +107,14 @@ def setup(verbosity, test_labels):
|
||||
# in our tests.
|
||||
settings.MANAGERS = ("admin@djangoproject.com",)
|
||||
|
||||
if verbosity > 0:
|
||||
# Ensure any warnings captured to logging are piped through a verbose
|
||||
# logging handler. If any -W options were passed explicitly on command
|
||||
# line, warnings are not captured, and this has no effect.
|
||||
logger = logging.getLogger('py.warnings')
|
||||
handler = logging.StreamHandler()
|
||||
logger.addHandler(handler)
|
||||
|
||||
# Load all the ALWAYS_INSTALLED_APPS.
|
||||
# (This import statement is intentionally delayed until after we
|
||||
# access settings because of the USE_I18N dependency.)
|
||||
|
||||
Reference in New Issue
Block a user