summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_coercion.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_coercion.py')
-rw-r--r--Lib/test/test_coercion.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/Lib/test/test_coercion.py b/Lib/test/test_coercion.py
index 67d19a6..34eb19e 100644
--- a/Lib/test/test_coercion.py
+++ b/Lib/test/test_coercion.py
@@ -223,8 +223,10 @@ def process_infix_results():
infix_results[key] = res
-
-process_infix_results()
+with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", "classic int division",
+ DeprecationWarning)
+ process_infix_results()
# now infix_results has two lists of results for every pairing.
prefix_binops = [ 'divmod' ]
@@ -337,11 +339,12 @@ class CoercionTest(unittest.TestCase):
raise exc
def test_main():
- warnings.filterwarnings("ignore",
- r'complex divmod\(\), // and % are deprecated',
- DeprecationWarning,
- r'test.test_coercion$')
- run_unittest(CoercionTest)
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", "complex divmod.., // and % "
+ "are deprecated", DeprecationWarning)
+ warnings.filterwarnings("ignore", "classic (int|long) division",
+ DeprecationWarning)
+ run_unittest(CoercionTest)
if __name__ == "__main__":
test_main()