Ticket #19546: 19546.diff

File 19546.diff, 930 bytes (added by Claude Paroz, 12 years ago)
  • django/test/simple.py

    diff --git a/django/test/simple.py b/django/test/simple.py
    index bf0219d..70f61b6 100644
    a b  
     1import logging
    12import unittest as real_unittest
    23
    34from django.conf import settings
    class DjangoTestSuiteRunner(object):  
    365366        self.setup_test_environment()
    366367        suite = self.build_suite(test_labels, extra_tests)
    367368        old_config = self.setup_databases()
     369        if self.verbosity > 0:
     370            # Display DeprecationWarning on sys.stderr
     371            logger = logging.getLogger('py.warnings')
     372            handler = logging.StreamHandler()
     373            logger.addHandler(handler)
    368374        result = self.run_suite(suite)
     375        if self.verbosity > 0:
     376            logger.removeHandler(handler)
    369377        self.teardown_databases(old_config)
    370378        self.teardown_test_environment()
    371379        return self.suite_result(suite, result)
Back to Top