Reduce the number of test-suite DeprecationWarnings; start adding
resetwarnings() calls too.
diff --git a/Lib/test/test_coercion.py b/Lib/test/test_coercion.py
index d39e6fd..6c0ee7b 100644
--- a/Lib/test/test_coercion.py
+++ b/Lib/test/test_coercion.py
@@ -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 @@
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()