summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_call.py
diff options
context:
space:
mode:
authorSylvain <sylvain.desodt+github@gmail.com>2017-07-09 03:45:06 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-07-09 03:45:06 (GMT)
commit9648088e6ccd6d0cc04f450f55628fd8eda3784c (patch)
tree8e2e1d797604ea31db5f30070f38a955f213def3 /Lib/test/test_call.py
parentaa6a4d6ed881f79c51fb91dd928ed9496737b420 (diff)
downloadcpython-9648088e6ccd6d0cc04f450f55628fd8eda3784c.zip
cpython-9648088e6ccd6d0cc04f450f55628fd8eda3784c.tar.gz
cpython-9648088e6ccd6d0cc04f450f55628fd8eda3784c.tar.bz2
bpo-30878: Fix error message when keyword arguments are passed (#2635)
to staticmethod() and classmethod().
Diffstat (limited to 'Lib/test/test_call.py')
-rw-r--r--Lib/test/test_call.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py
index ca678b9..b004b58 100644
--- a/Lib/test/test_call.py
+++ b/Lib/test/test_call.py
@@ -186,6 +186,14 @@ class CFunctionCallsErrorMessages(unittest.TestCase):
msg = r"^pack\(\) takes no keyword arguments$"
self.assertRaisesRegex(TypeError, msg, struct.Struct.pack, struct.Struct(""), x=2)
+ def test_varargs12_kw(self):
+ msg = r"^staticmethod\(\) takes no keyword arguments$"
+ self.assertRaisesRegex(TypeError, msg, staticmethod, func=id)
+
+ def test_varargs13_kw(self):
+ msg = r"^classmethod\(\) takes no keyword arguments$"
+ self.assertRaisesRegex(TypeError, msg, classmethod, func=id)
+
def test_oldargs0_1(self):
msg = r"keys\(\) takes no arguments \(1 given\)"
self.assertRaisesRegex(TypeError, msg, {}.keys, 0)