Kaydet (Commit) 32517041 authored tarafından Russell Keith-Magee's avatar Russell Keith-Magee

Silenced DeprecationWarning caused by testing deprecated DjangoTestRunner

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15997 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 4749159d
...@@ -2,12 +2,22 @@ ...@@ -2,12 +2,22 @@
Tests for django test runner Tests for django test runner
""" """
import StringIO import StringIO
import warnings
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.test import simple from django.test import simple
from django.test.utils import get_warnings_state, restore_warnings_state
from django.utils import unittest from django.utils import unittest
class DjangoTestRunnerTests(unittest.TestCase): class DjangoTestRunnerTests(unittest.TestCase):
def setUp(self):
self._warnings_state = get_warnings_state()
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='django.test.simple')
def tearDown(self):
restore_warnings_state(self._warnings_state)
def test_failfast(self): def test_failfast(self):
class MockTestOne(unittest.TestCase): class MockTestOne(unittest.TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment