summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-06-09 16:27:06 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-06-09 16:27:06 (GMT)
commitf9f1ccace395a8f65b60dc12567a237b4002fd18 (patch)
tree548d13d71b8c4add81e9a1f677fd2b060ff958a3 /Lib
parent57161aac5eb9bcb0b43e551a1937ff0a84c1ec52 (diff)
downloadcpython-f9f1ccace395a8f65b60dc12567a237b4002fd18.zip
cpython-f9f1ccace395a8f65b60dc12567a237b4002fd18.tar.gz
cpython-f9f1ccace395a8f65b60dc12567a237b4002fd18.tar.bz2
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.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_call.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py
index d929cfc..1e84b52 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)