From f9f1ccace395a8f65b60dc12567a237b4002fd18 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 9 Jun 2017 19:27:06 +0300 Subject: Fix regression in error message introduced in bpo-29951. (#2028) * Fix regression in error message introduced in bpo-29951. * Add test. * Make the test more strong. --- Lib/test/test_call.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Lib/test/test_call.py') diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py index d929cfc088..1e84b525f7 100644 --- a/Lib/test/test_call.py +++ b/Lib/test/test_call.py @@ -136,6 +136,10 @@ class CFunctionCallsErrorMessages(unittest.TestCase): msg = r"__contains__\(\) takes exactly one argument \(2 given\)" self.assertRaisesRegex(TypeError, msg, {}.__contains__, 0, 1) + def test_varargs3(self): + msg = r"^from_bytes\(\) takes at most 2 positional arguments \(3 given\)" + self.assertRaisesRegex(TypeError, msg, int.from_bytes, b'a', 'little', False) + def test_varargs1_kw(self): msg = r"__contains__\(\) takes no keyword arguments" self.assertRaisesRegex(TypeError, msg, {}.__contains__, x=2) -- cgit v1.2.1