mirror of
https://github.com/python/cpython.git
synced 2025-07-25 12:14:38 +00:00
[3.13] gh-131339: test PyBytes_Size for a zero-size bytes object (GH-131340) (#131343)
gh-131339: test PyBytes_Size for a zero-size bytes object (GH-131340)
(cherry picked from commit 3ae67ba97e
)
Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
This commit is contained in:
parent
4d7d249a05
commit
3930b7c258
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