]> granicus.if.org Git - python/commitdiff
only run doctests when __doc__ is around
authorBenjamin Peterson <benjamin@python.org>
Tue, 16 Oct 2012 13:51:46 +0000 (09:51 -0400)
committerBenjamin Peterson <benjamin@python.org>
Tue, 16 Oct 2012 13:51:46 +0000 (09:51 -0400)
Lib/test/test_cookie.py

index 1fb9b7db9febc66d87da9c2fbf7e62beafa2dee9..816133e497272628133f2cb7554fbbcb02e2da25 100644 (file)
@@ -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()