summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_coercion.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-04-15 23:52:04 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-04-15 23:52:04 (GMT)
commitf022a4d451d1d91d3462a7508b0bda8ef3d7ff24 (patch)
tree61d760a09dabd3a6616e32b958aeda855b9450c3 /Lib/test/test_coercion.py
parentc15acef4a4ba251f4c4fff38665ebd1c2c81e5f2 (diff)
downloadcpython-f022a4d451d1d91d3462a7508b0bda8ef3d7ff24.zip
cpython-f022a4d451d1d91d3462a7508b0bda8ef3d7ff24.tar.gz
cpython-f022a4d451d1d91d3462a7508b0bda8ef3d7ff24.tar.bz2
Reduce the number of test-suite DeprecationWarnings; start adding
resetwarnings() calls too.
Diffstat (limited to 'Lib/test/test_coercion.py')
-rw-r--r--Lib/test/test_coercion.py11
1 files changed, 9 insertions, 2 deletions
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 @@ 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()