diff options
Diffstat (limited to 'Lib/test/test_int.py')
| -rw-r--r-- | Lib/test/test_int.py | 17 |
1 files changed, 10 insertions, 7 deletions
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 @@ class IntTestCases(IntLongCommonTests, unittest.TestCase): 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 @@ class IntTestCases(IntLongCommonTests, unittest.TestCase): 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') |
