Fixed Py3k warnings in tests for issue #24731.
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py
index 0dd8efc..ea5c0e3 100644
--- a/Lib/test/test_int.py
+++ b/Lib/test/test_int.py
@@ -351,7 +351,8 @@
factories += [unicode, CustomUnicode]
for f in factories:
- x = f('100')
+ with test_support.check_py3k_warnings(quiet=True):
+ x = f('100')
msg = 'x has value %s and type %s' % (x, type(x).__name__)
try:
self.assertEqual(int(x), 100, msg=msg)
@@ -365,15 +366,17 @@
with self.assertRaisesRegexp(TypeError, errmsg, msg=msg):
int(x, 2)
errmsg = 'invalid literal'
- with self.assertRaisesRegexp(ValueError, errmsg, msg=msg):
+ with self.assertRaisesRegexp(ValueError, errmsg, msg=msg), \
+ test_support.check_py3k_warnings(quiet=True):
int(f('A' * 0x10))
def test_int_buffer(self):
- self.assertEqual(int(buffer('123', 1, 2)), 23)
- self.assertEqual(int(buffer('123\x00', 1, 2)), 23)
- self.assertEqual(int(buffer('123 ', 1, 2)), 23)
- self.assertEqual(int(buffer('123A', 1, 2)), 23)
- self.assertEqual(int(buffer('1234', 1, 2)), 23)
+ with test_support.check_py3k_warnings():
+ self.assertEqual(int(buffer('123', 1, 2)), 23)
+ self.assertEqual(int(buffer('123\x00', 1, 2)), 23)
+ self.assertEqual(int(buffer('123 ', 1, 2)), 23)
+ self.assertEqual(int(buffer('123A', 1, 2)), 23)
+ self.assertEqual(int(buffer('1234', 1, 2)), 23)
def test_error_on_string_float_for_x(self):
self.assertRaises(ValueError, int, '1.2')