]> granicus.if.org Git - python/commitdiff
#9964: fix running test_xml_etree under -OO.
authorGeorg Brandl <georg@python.org>
Thu, 14 Oct 2010 07:32:52 +0000 (07:32 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 14 Oct 2010 07:32:52 +0000 (07:32 +0000)
Lib/test/test_xml_etree.py

index 39997cc5ee934de221a51563663520e5354f9f6a..8079b84de66cb878c1fa34a8689b9b709c14546a 100644 (file)
@@ -1835,6 +1835,10 @@ class CleanContext(object):
     checkwarnings = None
 
     def __init__(self, quiet=False):
+        if sys.flags.optimize >= 2:
+            # under -OO, doctests cannot be run and therefore not all warnings
+            # will be emitted
+            quiet = True
         deprecations = (
             # Search behaviour is broken if search path starts with "/".
             ("This search is broken in 1.3 and earlier, and will be fixed "