summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_call.py
diff options
context:
space:
mode:
authorXtreak <tirkarthi@users.noreply.github.com>2018-07-22 20:13:26 (GMT)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2018-07-22 20:13:26 (GMT)
commit1426daa4fe47d8f8be0d416f7cba7adae1d5839f (patch)
treed8b7b72876b1ee768402fcb320f9e0bdfa0f9b37 /Lib/test/test_call.py
parentc75c1e0e8aeb720ac3fcfab119b70cabba4e8235 (diff)
downloadcpython-1426daa4fe47d8f8be0d416f7cba7adae1d5839f.zip
cpython-1426daa4fe47d8f8be0d416f7cba7adae1d5839f.tar.gz
cpython-1426daa4fe47d8f8be0d416f7cba7adae1d5839f.tar.bz2
bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)
Diffstat (limited to 'Lib/test/test_call.py')
-rw-r--r--Lib/test/test_call.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py
index 3f9987c..ec9697a 100644
--- a/Lib/test/test_call.py
+++ b/Lib/test/test_call.py
@@ -143,6 +143,22 @@ class CFunctionCallsErrorMessages(unittest.TestCase):
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_varargs4(self):
+ msg = r"get expected at least 1 argument, got 0"
+ self.assertRaisesRegex(TypeError, msg, {}.get)
+
+ def test_varargs5(self):
+ msg = r"getattr expected at least 2 arguments, got 0"
+ self.assertRaisesRegex(TypeError, msg, getattr)
+
+ def test_varargs6(self):
+ msg = r"input expected at most 1 argument, got 2"
+ self.assertRaisesRegex(TypeError, msg, input, 1, 2)
+
+ def test_varargs7(self):
+ msg = r"get expected at most 2 arguments, got 3"
+ self.assertRaisesRegex(TypeError, msg, {}.get, 1, 2, 3)
+
def test_varargs1_kw(self):
msg = r"__contains__\(\) takes no keyword arguments"
self.assertRaisesRegex(TypeError, msg, {}.__contains__, x=2)