summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ast.py3
-rw-r--r--Lib/test/test_keywordonlyarg.py7
2 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 4883ed5..03a877b 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -58,6 +58,9 @@ exec_tests = [
"break",
# Continue
"continue",
+ # kw only funcs
+ "def f(*, kw=1): pass",
+ "def f(*, **kw): pass",
]
# These are compiled through "single"
diff --git a/Lib/test/test_keywordonlyarg.py b/Lib/test/test_keywordonlyarg.py
index fc67c98..124257e 100644
--- a/Lib/test/test_keywordonlyarg.py
+++ b/Lib/test/test_keywordonlyarg.py
@@ -144,6 +144,13 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
except TypeError:
pass
+ def test_doublestar_only(self):
+ def f(*, **kw):
+ return kw
+
+ self.assertEqual(f(), {})
+ self.assertEqual(f(k1=1, k2=2), {'k1' : 1, 'k2' : 2})
+
def test_main():
run_unittest(KeywordOnlyArgTestCase)