From bf67ba8f84f3e771193b44b25526d0258826052e Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 16 Oct 2012 09:51:46 -0400 Subject: [PATCH] only run doctests when __doc__ is around --- Lib/test/test_cookie.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_cookie.py b/Lib/test/test_cookie.py index 1fb9b7db9fe..816133e4972 100644 --- a/Lib/test/test_cookie.py +++ b/Lib/test/test_cookie.py @@ -90,9 +90,10 @@ class CookieTests(unittest.TestCase): def test_main(): run_unittest(CookieTests) - with check_warnings(('.+Cookie class is insecure; do not use it', - DeprecationWarning)): - run_doctest(Cookie) + if Cookie.__doc__ is not None: + with check_warnings(('.+Cookie class is insecure; do not use it', + DeprecationWarning)): + run_doctest(Cookie) if __name__ == '__main__': test_main()