summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-17 04:15:01 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-01-17 04:15:01 (GMT)
commit9953a8dfd6b078b58a7c73991660537677d11b56 (patch)
tree2d436fb4412751395ad065101f75cfa1f31806df /Lib/test/test_inspect.py
parentc10c34d6cb0d06632c7706a16cb3d448e0c3cfce (diff)
downloadcpython-9953a8dfd6b078b58a7c73991660537677d11b56.zip
cpython-9953a8dfd6b078b58a7c73991660537677d11b56.tar.gz
cpython-9953a8dfd6b078b58a7c73991660537677d11b56.tar.bz2
fix inspect.formatargspec on functions with keyword-only arguments without defaults #4959
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index ac9fcd7..b3aa28c 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -386,6 +386,9 @@ class TestClassesAndFunctions(unittest.TestCase):
self.assertRaises(ValueError, self.assertArgSpecEquals,
mod2.annotated, [])
+ self.assertRaises(ValueError, self.assertArgSpecEquals,
+ mod2.keyword_only_arg, [])
+
def test_getfullargspec(self):
self.assertFullArgSpecEquals(mod2.keyworded, [], varargs_e='arg1',
@@ -396,6 +399,10 @@ class TestClassesAndFunctions(unittest.TestCase):
self.assertFullArgSpecEquals(mod2.annotated, ['arg1'],
ann_e={'arg1' : list},
formatted='(arg1: list)')
+ self.assertFullArgSpecEquals(mod2.keyword_only_arg, [],
+ kwonlyargs_e=['arg'],
+ formatted='(*, arg)')
+
def test_getargspec_method(self):
class A(object):