mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
greatly improve argument parsing error messages (closes #12265)
This commit is contained in:
parent
40b408d455
commit
b204a42383
5 changed files with 307 additions and 204 deletions
|
@ -78,7 +78,7 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
|
|||
pass
|
||||
with self.assertRaises(TypeError) as exc:
|
||||
f(1, 2, 3)
|
||||
expected = "f() takes at most 2 positional arguments (3 given)"
|
||||
expected = "f() takes from 1 to 2 positional arguments but 3 were given"
|
||||
self.assertEqual(str(exc.exception), expected)
|
||||
|
||||
def testSyntaxErrorForFunctionCall(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue