From: Brett Cannon Date: Sat, 20 Mar 2010 21:51:10 +0000 (+0000) Subject: Fix the warnings filter usage in test_http_cookies. X-Git-Tag: v3.2a1~1387 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3791ed4502c4f73a2c1714fa59a541ddc605e89;p=python Fix the warnings filter usage in test_http_cookies. --- diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py index 158dd634b0..4d9c9ca3be 100644 --- a/Lib/test/test_http_cookies.py +++ b/Lib/test/test_http_cookies.py @@ -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',