mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
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.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
@@ -82,6 +83,14 @@ def setup(verbosity, test_labels):
|
||||
settings.LANGUAGE_CODE = 'en'
|
||||
settings.SITE_ID = 1
|
||||
|
||||
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.
|
||||
get_apps()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user