]> granicus.if.org Git - python/commitdiff
Reduce the number of test-suite DeprecationWarnings; start adding
authorTim Peters <tim.peters@gmail.com>
Mon, 15 Apr 2002 23:52:04 +0000 (23:52 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 15 Apr 2002 23:52:04 +0000 (23:52 +0000)
resetwarnings() calls too.

Lib/test/test___all__.py
Lib/test/test_coercion.py
Lib/test/test_xmllib.py

index 299054f838763945ef6aabaf3bbd14b9ca660041..2890066f135368ab0c6f41a7cc35a6ae7e655cf6 100644 (file)
@@ -158,3 +158,5 @@ check_all("weakref")
 check_all("webbrowser")
 check_all("xdrlib")
 check_all("zipfile")
+
+warnings.resetwarnings()
index d39e6fd046e1a675cbb232c235898cdaddadd4b2..6c0ee7b18be6dd93364d41f8147de771b54086f9 100644 (file)
@@ -1,5 +1,6 @@
 import copy
 import sys
+import warnings
 
 # Fake a number that implements numeric methods through __coerce__
 class CoerceNumber:
@@ -109,5 +110,11 @@ def do_prefix_binops():
                 else:
                     print '=', x
 
-do_infix_binops()
-do_prefix_binops()
+warnings.filterwarnings("ignore",
+                        r'complex divmod\(\), // and % are deprecated',
+                        DeprecationWarning)
+try:
+    do_infix_binops()
+    do_prefix_binops()
+finally:
+    warnings.resetwarnings()
index 97ae14110172e7fb0381ff41f6bb56754142a108..6756b643744fcfee459e406330b15d40846da182 100644 (file)
@@ -16,7 +16,6 @@ testdoc = """\
 import warnings
 warnings.filterwarnings("ignore", ".* xmllib .* obsolete.*",
                         DeprecationWarning)
-del warnings
 
 import test_support
 import unittest
@@ -33,6 +32,7 @@ class XMLParserTestCase(unittest.TestCase):
 
 def test_main():
     test_support.run_unittest(XMLParserTestCase)
+    warnings.resetwarnings()
 
 
 if __name__ == "__main__":