[3.11] gh-67565: Add tests for C-contiguity checks (GH-110951) (GH-111199)

(cherry picked from commit 9376728ce4)
This commit is contained in:
Furkan Onder 2023-10-23 12:49:44 +03:00 committed by GitHub
parent 0a23960266
commit f446df741f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 0 deletions

View file

@ -1952,6 +1952,10 @@ class MemoryBIOTests(unittest.TestCase):
self.assertEqual(bio.read(), b'bar')
bio.write(memoryview(b'baz'))
self.assertEqual(bio.read(), b'baz')
m = memoryview(bytearray(b'noncontig'))
noncontig_writable = m[::-2]
with self.assertRaises(BufferError):
bio.write(memoryview(noncontig_writable))
def test_error_types(self):
bio = ssl.MemoryBIO()