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 into
Conversation
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
|
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, something went wrong.
|
Sorry, @furkanonder and @serhiy-storchaka, I could not cleanly backport this to |
Sorry, something went wrong.
|
Sorry, @furkanonder and @serhiy-storchaka, I could not cleanly backport this to |
Sorry, something went wrong.
(cherry picked from commit 9376728)
|
@serhiy-storchaka The bot couldn't backport the changes because of the conflicts. I opened it manually. Can you merge these PRs? |
Sorry, something went wrong.
|
Thank you Furkan. Were they all conflicts in Argument Clinic generated code? |
Sorry, something went wrong.
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): |
Sorry, something went wrong.
edited by bedevere-app
Bot
LoadingUh oh!
There was an error while loading. Please reload this page.
Copy link Copy MarkdownSorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.