diff options
author | Brett Cannon <bcannon@gmail.com> | 2010-03-20 21:51:10 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2010-03-20 21:51:10 (GMT) |
commit | d3791ed4502c4f73a2c1714fa59a541ddc605e89 (patch) | |
tree | 17bd20216d34b8aa2e917c572b4b90cea6bf8978 /Lib/test | |
parent | 2298d538b3f5db9dcd14a1dd1eb38a1e9eee1a94 (diff) | |
download | cpython-d3791ed4502c4f73a2c1714fa59a541ddc605e89.zip cpython-d3791ed4502c4f73a2c1714fa59a541ddc605e89.tar.gz cpython-d3791ed4502c4f73a2c1714fa59a541ddc605e89.tar.bz2 |
Fix the warnings filter usage in test_http_cookies.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_http_cookies.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py index 158dd63..4d9c9ca 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', |