Skip to content

Instantly share code, notes, and snippets.

@loic
Created April 13, 2014 11:29
Show Gist options
  • Save loic/10580049 to your computer and use it in GitHub Desktop.
Save loic/10580049 to your computer and use it in GitHub Desktop.
diff --git a/tests/runtests.py b/tests/runtests.py
index e852346..0506532 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -19,6 +19,15 @@ from django.utils import six
warnings.simplefilter("default", RemovedInDjango19Warning)
warnings.simplefilter("default", RemovedInDjango20Warning)
+
+import traceback
+showwarning = warnings.showwarning
+def showwarning_with_traceback(*args, **kwargs):
+ traceback.print_stack()
+ return showwarning(*args, **kwargs)
+warnings.showwarning = showwarning_with_traceback
+
+
CONTRIB_MODULE_PATH = 'django.contrib'
TEST_TEMPLATE_DIR = 'templates'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment