mirror of
https://github.com/python/cpython.git
synced 2025-08-08 10:58:51 +00:00
[3.11] gh-67565: Add tests for C-contiguity checks (GH-110951) (GH-111199)
(cherry picked from commit 9376728ce4
)
This commit is contained in:
parent
0a23960266
commit
f446df741f
3 changed files with 29 additions and 0 deletions
|
@ -428,6 +428,12 @@ class BinASCIITest(unittest.TestCase):
|
|||
self.assertEqual(binascii.b2a_base64(b, newline=False),
|
||||
b'aGVsbG8=')
|
||||
|
||||
def test_c_contiguity(self):
|
||||
m = memoryview(bytearray(b'noncontig'))
|
||||
noncontig_writable = m[::-2]
|
||||
with self.assertRaises(BufferError):
|
||||
binascii.b2a_hex(noncontig_writable)
|
||||
|
||||
|
||||
class ArrayBinASCIITest(BinASCIITest):
|
||||
def type2test(self, s):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue