diff options
Diffstat (limited to 'Lib/test/test_long.py')
-rw-r--r-- | Lib/test/test_long.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index c47b8e3..133702e 100644 --- a/Lib/test/test_long.py +++ b/Lib/test/test_long.py @@ -345,6 +345,16 @@ class LongTest(unittest.TestCase): self.assertRaises(ValueError, int, '08', 0) self.assertRaises(ValueError, int, '-012395', 0) + # invalid bases + invalid_bases = [-909, + 2**31-1, 2**31, -2**31, -2**31-1, + 2**63-1, 2**63, -2**63, -2**63-1, + 2**100, -2**100, + ] + for base in invalid_bases: + self.assertRaises(ValueError, int, '42', base) + + def test_conversion(self): class JustLong: |