[Python-checkins] r79152 - python/branches/py3k/Lib/test/test_http_cookies.py
brett.cannon
python-checkins at python.org
Sat Mar 20 22:51:10 CET 2010
Author: brett.cannon
Date: Sat Mar 20 22:51:10 2010
New Revision: 79152
Log:
Fix the warnings filter usage in test_http_cookies.
Modified:
python/branches/py3k/Lib/test/test_http_cookies.py
Modified: python/branches/py3k/Lib/test/test_http_cookies.py
==============================================================================
--- python/branches/py3k/Lib/test/test_http_cookies.py (original)
+++ python/branches/py3k/Lib/test/test_http_cookies.py Sat Mar 20 22:51:10 2010
@@ -1,15 +1,22 @@
# Simple test suite for http/cookies.py
-from test.support import run_unittest, run_doctest
+from test.support import run_unittest, run_doctest, check_warnings
import unittest
from http import cookies
import warnings
-warnings.filterwarnings("ignore",
- ".* class is insecure.*",
- DeprecationWarning)
class CookieTests(unittest.TestCase):
+
+ def setUp(self):
+ self._warnings_manager = check_warnings()
+ self._warnings_manager.__enter__()
+ warnings.filterwarnings("ignore", ".* class is insecure.*",
+ DeprecationWarning)
+
+ def tearDown(self):
+ self._warnings_manager.__exit__(None, None, None)
+
def test_basic(self):
cases = [
{ 'data': 'chips=ahoy; vienna=finger',
More information about the Python-checkins
mailing list