mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-67565: Add tests for C-contiguity checks (GH-110951)
This commit is contained in:
parent
677d4bc15e
commit
9376728ce4
3 changed files with 29 additions and 0 deletions
|
|
@ -474,6 +474,12 @@ class BinASCIITest(unittest.TestCase):
|
|||
restored = binascii.a2b_base64(self.type2test(converted))
|
||||
self.assertConversion(binary, converted, restored, newline=newline)
|
||||
|
||||
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