gh-67565: Add tests for the remove redundant C-contiguity checks#110951
gh-67565: Add tests for the remove redundant C-contiguity checks#110951serhiy-storchaka merged 2 commits intopython:mainfrom
Conversation
|
Thanks @furkanonder for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
|
Sorry, @furkanonder and @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @furkanonder and @serhiy-storchaka, I could not cleanly backport this to |
(cherry picked from commit 9376728)
|
GH-111198 is a backport of this pull request to the 3.12 branch. |
|
GH-111199 is a backport of this pull request to the 3.11 branch. |
|
@serhiy-storchaka The bot couldn't backport the changes because of the conflicts. I opened it manually. Can you merge these PRs? |
|
Thank you Furkan. Were they all conflicts in Argument Clinic generated code? |
The only file that creates conflict is --- a/Lib/test/test_binascii.py
+++ b/Lib/test/test_binascii.py
@@@ -428,6 -465,21 +428,24 @@@ class BinASCIITest(unittest.TestCase)
self.assertEqual(binascii.b2a_base64(b, newline=False),
b'aGVsbG8=')
++<<<<<<< HEAD
++=======
+ @hypothesis.given(
+ binary=hypothesis.strategies.binary(),
+ newline=hypothesis.strategies.booleans(),
+ )
+ def test_base64_roundtrip(self, binary, newline):
+ converted = binascii.b2a_base64(self.type2test(binary), newline=newline)
+ 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)
+
++>>>>>>> 9376728ce4 (gh-67565: Add tests for C-contiguity checks (GH-110951))
class ArrayBinASCIITest(BinASCIITest):
def type2test(self, s): |
Uh oh!
There was an error while loading. Please reload this page.