https://github.com/python/cpython/commit/3ae67ba97e88d6f066a5b6f0c809f57fe4a1ecbe
commit: 3ae67ba97e88d6f066a5b6f0c809f57fe4a1ecbe
branch: main
author: Nybblista <170842536+nybbli...@users.noreply.github.com>
committer: sobolevn <m...@sobolevn.me>
date: 2025-03-17T11:38:37+03:00
summary:

gh-131339: test PyBytes_Size for a zero-size bytes object (#131340)

files:
M Lib/test/test_capi/test_bytes.py

diff --git a/Lib/test/test_capi/test_bytes.py b/Lib/test/test_capi/test_bytes.py
index 5908d79e14029b..5b61c73381542d 100644
--- a/Lib/test/test_capi/test_bytes.py
+++ b/Lib/test/test_capi/test_bytes.py
@@ -93,6 +93,7 @@ def test_size(self):
         # 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'))

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to