mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Make bytesobject raise ValueError instead of TypeError again (thanks, Nick)
This commit is contained in:
parent
89da5d7c3d
commit
d204a715f4
2 changed files with 8 additions and 8 deletions
|
@ -60,13 +60,13 @@ class BytesTest(unittest.TestCase):
|
|||
self.assertRaises(ValueError, bytes, [-1])
|
||||
self.assertRaises(ValueError, bytes, [-sys.maxint])
|
||||
self.assertRaises(ValueError, bytes, [-sys.maxint-1])
|
||||
self.assertRaises(TypeError, bytes, [-sys.maxint-2])
|
||||
self.assertRaises(TypeError, bytes, [-10**100])
|
||||
self.assertRaises(ValueError, bytes, [-sys.maxint-2])
|
||||
self.assertRaises(ValueError, bytes, [-10**100])
|
||||
self.assertRaises(ValueError, bytes, [256])
|
||||
self.assertRaises(ValueError, bytes, [257])
|
||||
self.assertRaises(ValueError, bytes, [sys.maxint])
|
||||
self.assertRaises(TypeError, bytes, [sys.maxint+1])
|
||||
self.assertRaises(TypeError, bytes, [10**100])
|
||||
self.assertRaises(ValueError, bytes, [sys.maxint+1])
|
||||
self.assertRaises(ValueError, bytes, [10**100])
|
||||
|
||||
def test_repr(self):
|
||||
self.assertEqual(repr(bytes()), "bytes()")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue