diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py --- a/Lib/test/test_int.py +++ b/Lib/test/test_int.py @@ -74,7 +74,6 @@ self.assertEqual(x >> 1, x//2) self.assertRaises(ValueError, int, '123\0') - self.assertRaises(ValueError, int, '53', 40) # SF bug 1545497: embedded NULs were not detected with # explicit base @@ -305,6 +304,14 @@ self.fail("Failed to raise TypeError with %s" % ((base, trunc_result_base),)) + def test_bad_base(self): + self.assertRaises(ValueError, int, '53', 40) + + with self.assertRaises(ValueError) as e: + int('100', 1) + self.assertEquals(str(e.exception), + "int() arg base must be 0 or >= 2 and <= 36") + def test_error_message(self): testlist = ('\xbd', '123\xbd', ' 123 456 ') for s in testlist: