Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_cookie.py @ 63634:762d89faceaa 2.6
Merged revisions 79539 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79539 | florent.xicluna | 2010-04-01 01:01:03 +0300 (Thu, 01 Apr 2010) | 2 lines
Replace catch_warnings with check_warnings when it makes sense. Use assertRaises context manager to simplify some tests.
........
| author | Ezio Melotti <ezio.melotti@gmail.com> |
|---|---|
| date | Mon, 02 Aug 2010 23:34:49 +0000 |
| parents | 61ad81a774c5 |
| children | b36cb4602e21 |
line wrap: on
line diff
--- a/Lib/test/test_cookie.py Mon Aug 02 22:01:34 2010 +0000 +++ b/Lib/test/test_cookie.py Mon Aug 02 23:34:49 2010 +0000 @@ -1,13 +1,9 @@ # Simple test suite for Cookie.py -from test.test_support import run_unittest, run_doctest +from test.test_support import run_unittest, run_doctest, check_warnings import unittest import Cookie -import warnings -warnings.filterwarnings("ignore", - ".* class is insecure.*", - DeprecationWarning) class CookieTests(unittest.TestCase): # Currently this only tests SimpleCookie @@ -86,7 +82,9 @@ def test_main(): run_unittest(CookieTests) - run_doctest(Cookie) + with check_warnings(('.+Cookie class is insecure; do not use it', + DeprecationWarning)): + run_doctest(Cookie) if __name__ == '__main__': test_main()
