Added two tests for f(*, **kw) syntax
This commit is contained in:
parent
bc8734174a
commit
0da5bd6ee1
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue