[pypy-commit] pypy default: Add a passing test for the usage case in

arigo noreply at buildbot.pypy.org
Fri Sep 6 15:35:06 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r66819:136ece4043c9
Date: 2013-09-06 15:34 +0200
http://bitbucket.org/pypy/pypy/changeset/136ece4043c9/

Log:	Add a passing test for the usage case in
	pypy/module/_cffi_backend/newtype:new_primitive_type()

diff --git a/rpython/rtyper/test/test_rclass.py b/rpython/rtyper/test/test_rclass.py
--- a/rpython/rtyper/test/test_rclass.py
+++ b/rpython/rtyper/test/test_rclass.py
@@ -1192,3 +1192,19 @@
 
         assert self.interpret(f, [True]) == f(True)
         assert self.interpret(f, [False]) == f(False)
+
+    def test_init_with_star_args(self):
+        class Base(object):
+            def __init__(self, a, b):
+                self.a = a
+                self.b = b
+        class A(Base):
+            def __init__(self, *args):
+                Base.__init__(self, *args)
+                self.c = -1
+        cls = [Base, A]
+
+        def f(k, a, b):
+            return cls[k](a, b).b
+
+        assert self.interpret(f, [1, 4, 7]) == 7


More information about the pypy-commit mailing list