[pypy-commit] pypy py3k: Add a test for keyword-only arguments

rguillebert noreply at buildbot.pypy.org
Sat Jan 21 15:54:38 CET 2012


Author: Romain Guillebert <romain.py at gmail.com>
Branch: py3k
Changeset: r51581:39eb4a258003
Date: 2012-01-21 15:53 +0100
http://bitbucket.org/pypy/pypy/changeset/39eb4a258003/

Log:	Add a test for keyword-only arguments

diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py b/pypy/interpreter/astcompiler/test/test_compiler.py
--- a/pypy/interpreter/astcompiler/test/test_compiler.py
+++ b/pypy/interpreter/astcompiler/test/test_compiler.py
@@ -810,6 +810,14 @@
         """
         yield self.st, func, "f()", (1, [2, 3, 4], 5)
 
+    def test_kwonlyargs_default_parameters(self):
+        """ This actually test an interpreter bug, but since we can't parse
+        py3k only code in the interpreter tests right now, it's there waiting
+        for this feature"""
+        func = """ def f(a, b, c=3, *, d=4):
+            return a, b, c, d
+        """
+        yield self.st, func, "f(1, 2)", (1, 2, 3, 4)
 
 class AppTestCompiler:
 


More information about the pypy-commit mailing list