summaryrefslogtreecommitdiff
path: root/django/test
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-20 11:04:58 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-20 11:09:06 +0100
commiteabc3b6c8dd67e9ff49da9f2f41cc653898cd0a1 (patch)
tree9c32bd49094c5a4866fcb26b66e92ead79881d83 /django/test
parent1b9cbef198809f5e765d17b1b6d49bad794dbd0a (diff)
Set stacklevel for the override_settings warning.
Refs #19031.
Diffstat (limited to 'django/test')
-rw-r--r--django/test/signals.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/test/signals.py b/django/test/signals.py
index 4af408ea9d..8086d50b32 100644
--- a/django/test/signals.py
+++ b/django/test/signals.py
@@ -97,4 +97,7 @@ def file_storage_changed(**kwargs):
@receiver(setting_changed)
def complex_setting_changed(**kwargs):
if kwargs['enter'] and kwargs['setting'] in COMPLEX_OVERRIDE_SETTINGS:
- warnings.warn("Overriding setting %s can lead to unexpected behaviour." % kwargs['setting'])
+ # Considering the current implementation of the signals framework,
+ # stacklevel=5 shows the line containing the override_settings call.
+ warnings.warn("Overriding setting %s can lead to unexpected behaviour."
+ % kwargs['setting'], stacklevel=5)