Code

Ticket #19546: 19546.diff

File 19546.diff, 930 bytes (added by claudep, 16 months ago)
Line 
1diff --git a/django/test/simple.py b/django/test/simple.py
2index bf0219d..70f61b6 100644
3--- a/django/test/simple.py
4+++ b/django/test/simple.py
5@@ -1,3 +1,4 @@
6+import logging
7 import unittest as real_unittest
8 
9 from django.conf import settings
10@@ -365,7 +366,14 @@ class DjangoTestSuiteRunner(object):
11         self.setup_test_environment()
12         suite = self.build_suite(test_labels, extra_tests)
13         old_config = self.setup_databases()
14+        if self.verbosity > 0:
15+            # Display DeprecationWarning on sys.stderr
16+            logger = logging.getLogger('py.warnings')
17+            handler = logging.StreamHandler()
18+            logger.addHandler(handler)
19         result = self.run_suite(suite)
20+        if self.verbosity > 0:
21+            logger.removeHandler(handler)
22         self.teardown_databases(old_config)
23         self.teardown_test_environment()
24         return self.suite_result(suite, result)