[pypy-commit] pypy issue2996: add test_call_starstar2 which passes

mattip pypy.commits at gmail.com
Sun Apr 14 02:22:00 EDT 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: issue2996
Changeset: r96469:1c0ce86bca73
Date: 2019-04-14 09:20 +0300
http://bitbucket.org/pypy/pypy/changeset/1c0ce86bca73/

Log:	add test_call_starstar2 which passes

diff --git a/pypy/objspace/std/test/test_callmethod.py b/pypy/objspace/std/test/test_callmethod.py
--- a/pypy/objspace/std/test/test_callmethod.py
+++ b/pypy/objspace/std/test/test_callmethod.py
@@ -22,15 +22,25 @@
             assert c.m(**{'u': 4}) == ((c,), {'u': 4})
         """)
 
-    def test_call_star(self):
+    def test_call_starstar1(self):
         exec("""if 1:
             class Foo:
-                def meth(self, a1, *args, offset=42):
-                    return args, offset
+                def meth(*args, a=2):
+                    return args, a
+            ret = Foo().meth(**{})
+            assert type(ret[0][0]) is Foo
+            assert ret[1] == 2
+        """)
 
-            ret = Foo().meth(12, **{})
+    def test_call_starstar2(self):
+        exec("""if 1:
+            class Foo:
+                def meth(*args, a=2, b=3):
+                    return args, a, b
+            ret = Foo().meth(**{})
             assert type(ret[0][0]) is Foo
-            assert ret[1] == 42
+            assert ret[1] == 2
+            assert ret[2] == 3
         """)
 
     def test_call_attribute(self):


More information about the pypy-commit mailing list