summaryrefslogtreecommitdiff
path: root/generated_tests
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-11-11 15:01:08 -0800
committerDylan Baker <baker.dylan.c@gmail.com>2015-11-12 11:25:45 -0800
commit1d125fe45f1bee91a59f9e43a435cabc335cea2f (patch)
treee3395a357cf9537a164e382f74c14253aab9f121 /generated_tests
parent40cea6215a6aabc64f884fd65d6ee2d626630786 (diff)
generated_tests/builtin_function.py: fix running with python 3.x
The current code works under python 2.7, but not python 3.x. This patch corrects that by making the code work for both. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Tested-by: Jan Vesely <jan.vesely@rutgers.edu>
Diffstat (limited to 'generated_tests')
-rw-r--r--generated_tests/builtin_function.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/generated_tests/builtin_function.py b/generated_tests/builtin_function.py
index 40ef70fbe..b5878512c 100644
--- a/generated_tests/builtin_function.py
+++ b/generated_tests/builtin_function.py
@@ -1281,7 +1281,8 @@ def _make_vector_or_matrix_test_vectors(test_suite_dict):
floats+vecs+mats+ints+ivecs+uints+uvecs],
template='{0};\n result += {1}')
# This can generate an overflow warning, this is expected
- with warnings.catch_warnings(RuntimeWarning):
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', RuntimeWarning)
f('op-assign-sub', 2, 110,
lambda x, y: x - y, match_assignment_operators,
[floats+vecs+mats+ints+ivecs+uints+uvecs,
@@ -1326,7 +1327,8 @@ def _make_vector_or_matrix_test_vectors(test_suite_dict):
floats+vecs+mats+ints+ivecs+uints+uvecs],
template='({0} + {1})')
# This can generate an overflow warning, this is expected
- with warnings.catch_warnings(RuntimeWarning):
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', RuntimeWarning)
f('op-sub', 2, 110, lambda x, y: x - y, match_simple_binop,
[floats+vecs+mats+ints+ivecs+uints+uvecs,
floats+vecs+mats+ints+ivecs+uints+uvecs],