-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. #1316
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
bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. #1316
Conversation
@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @tim-one and @larryhastings to be potential reviewers. |
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.
May add some test case
self.assertRaises(SystemError, _testcapi.parse_tuple_and_keywords, | ||
(), {}, '|$O', ['']) | ||
self.assertRaises(SystemError, _testcapi.parse_tuple_and_keywords, | ||
(), {}, '|OO', ['a', '']) |
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.
May add test case for misuse of ;
and :
self.assertRaises(SystemError, _testcapi.parse_tuple_and_keywords,
(1,), {}, ':O', ['a'])
self.assertRaises(SystemError, _testcapi.parse_tuple_and_keywords,
(1,), {}, ';O', ['a'])
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.
These tests don't trigger any error that is not tested.
|
||
def test_bad_use(self): | ||
# Test handling invalid format and keywords in | ||
# PyArg_ParseTupleAndKeywords() |
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.
Can this use the method below parser = _testcapi.parse_tuple_and_keywords
to reduce the length?
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.
This doesn't matter, in any case the line is wrapped.
…ords. (pythonGH-1316). (cherry picked from commit 5f161fd)
…ords. (pythonGH-1316). (cherry picked from commit 5f161fd)
No description provided.