mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-131339: test PyBytes_Size for a zero-size bytes object (#131340)
This commit is contained in:
parent
cf288e3c25
commit
3ae67ba97e
1 changed files with 1 additions and 0 deletions
|
@ -93,6 +93,7 @@ class CAPITest(unittest.TestCase):
|
|||
# Test PyBytes_Size()
|
||||
size = _testlimitedcapi.bytes_size
|
||||
|
||||
self.assertEqual(size(b''), 0)
|
||||
self.assertEqual(size(b'abc'), 3)
|
||||
self.assertEqual(size(BytesSubclass(b'abc')), 3)
|
||||
self.assertRaises(TypeError, size, bytearray(b'abc'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue