[Python-3000-checkins] r59433 - python/branches/py3k/Lib/test/test_ast.py python/branches/py3k/Lib/test/test_keywordonlyarg.py
christian.heimes
python-3000-checkins at python.org
Sat Dec 8 23:17:26 CET 2007
Author: christian.heimes
Date: Sat Dec 8 23:17:26 2007
New Revision: 59433
Modified:
python/branches/py3k/Lib/test/test_ast.py
python/branches/py3k/Lib/test/test_keywordonlyarg.py
Log:
Added two tests for f(*, **kw) syntax
Modified: python/branches/py3k/Lib/test/test_ast.py
==============================================================================
--- python/branches/py3k/Lib/test/test_ast.py (original)
+++ python/branches/py3k/Lib/test/test_ast.py Sat Dec 8 23:17:26 2007
@@ -58,6 +58,9 @@
"break",
# Continue
"continue",
+ # kw only funcs
+ "def f(*, kw=1): pass",
+ "def f(*, **kw): pass",
]
# These are compiled through "single"
Modified: python/branches/py3k/Lib/test/test_keywordonlyarg.py
==============================================================================
--- python/branches/py3k/Lib/test/test_keywordonlyarg.py (original)
+++ python/branches/py3k/Lib/test/test_keywordonlyarg.py Sat Dec 8 23:17:26 2007
@@ -144,6 +144,13 @@
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)
More information about the Python-3000-checkins
mailing list