only run doctests when __doc__ is around

This commit is contained in:
Benjamin Peterson 2012-10-16 09:51:46 -04:00
parent ae1d185750
commit bf67ba8f84

View 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()