-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-67565: Add tests for the remove redundant C-contiguity checks #110951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
furkanonder
commented
Oct 16, 2023
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: getargs.c: redundant C-contiguity check #67565
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
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): |