]> granicus.if.org Git - python/commitdiff
don't expect warnings from doctests if they can't run
authorBenjamin Peterson <benjamin@python.org>
Tue, 16 Oct 2012 00:38:21 +0000 (20:38 -0400)
committerBenjamin Peterson <benjamin@python.org>
Tue, 16 Oct 2012 00:38:21 +0000 (20:38 -0400)
Lib/test/test_doctest.py
Lib/test/test_zipimport_support.py

index 8c87beeebcad9ef570c7e7b255973836692d55a3..45057c8707800d91d2a7f94b5827fd883bd62260 100644 (file)
@@ -2673,7 +2673,9 @@ def test_main():
     from test import test_doctest
 
     # Ignore all warnings about the use of class Tester in this module.
-    deprecations = [("class Tester is deprecated", DeprecationWarning)]
+    deprecations = []
+    if __debug__:
+        deprecations.append(("class Tester is deprecated", DeprecationWarning))
     if sys.py3kwarning:
         deprecations += [("backquote not supported", SyntaxWarning),
                          ("execfile.. not supported", DeprecationWarning)]
index 199cf20e8d467301a42ad70931c479a32ca347e2..704f35c6b0e01605bfa07f181cb3d09481a15034 100644 (file)
@@ -179,9 +179,10 @@ class ZipSupportTests(ImportHooksBaseTestCase):
                 test_zipped_doctest.test_unittest_reportflags,
             ]
             # Needed for test_DocTestParser and test_debug
-            deprecations = [
+            deprecations = []
+            if __debug__:
                 # Ignore all warnings about the use of class Tester in this module.
-                ("class Tester is deprecated", DeprecationWarning)]
+                depcreations.append(("class Tester is deprecated", DeprecationWarning))
             if sys.py3kwarning:
                 deprecations += [
                     ("backquote not supported", SyntaxWarning),