bpo-34193: Fix pluralization in getargs.c and test cases. (GH-8438)

This commit is contained in:
Xtreak 2018-12-21 20:15:13 +05:30 committed by Serhiy Storchaka
parent 3e8f962e63
commit 6326278e8a
5 changed files with 38 additions and 23 deletions

View file

@ -682,11 +682,11 @@ class PositionalOnlyAndKeywords_TestCase(unittest.TestCase):
self.assertEqual(self.getargs(1), (1, -1, -1))
# required positional arg missing
with self.assertRaisesRegex(TypeError,
r"function takes at least 1 positional arguments \(0 given\)"):
r"function takes at least 1 positional argument \(0 given\)"):
self.getargs()
with self.assertRaisesRegex(TypeError,
r"function takes at least 1 positional arguments \(0 given\)"):
r"function takes at least 1 positional argument \(0 given\)"):
self.getargs(keyword=3)
def test_empty_keyword(self):
@ -1112,7 +1112,7 @@ class ParseTupleAndKeywords_Test(unittest.TestCase):
parse((1,), {'a': 3}, 'OOO', ['', '', 'a'])
parse((1,), {}, 'O|OO', ['', '', 'a'])
with self.assertRaisesRegex(TypeError,
r'function takes at least 1 positional arguments \(0 given\)'):
r'function takes at least 1 positional argument \(0 given\)'):
parse((), {}, 'O|OO', ['', '', 'a'])
parse((1, 2), {'a': 3}, 'OO$O', ['', '', 'a'])
with self.assertRaisesRegex(TypeError,
@ -1120,7 +1120,7 @@ class ParseTupleAndKeywords_Test(unittest.TestCase):
parse((1,), {'a': 3}, 'OO$O', ['', '', 'a'])
parse((1,), {}, 'O|O$O', ['', '', 'a'])
with self.assertRaisesRegex(TypeError,
r'function takes at least 1 positional arguments \(0 given\)'):
r'function takes at least 1 positional argument \(0 given\)'):
parse((), {}, 'O|O$O', ['', '', 'a'])
with self.assertRaisesRegex(SystemError, r'Empty parameter name after \$'):
parse((1,), {}, 'O|$OO', ['', '', 'a'])