[pypy-commit] pypy default: Bah, another case that doesn't work correctly.

arigo noreply at buildbot.pypy.org
Wed Mar 7 18:08:43 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r53254:0acb3979ffd3
Date: 2012-03-04 22:05 +0100
http://bitbucket.org/pypy/pypy/changeset/0acb3979ffd3/

Log:	Bah, another case that doesn't work correctly.

diff --git a/pypy/annotation/test/test_annrpython.py b/pypy/annotation/test/test_annrpython.py
--- a/pypy/annotation/test/test_annrpython.py
+++ b/pypy/annotation/test/test_annrpython.py
@@ -2431,6 +2431,38 @@
         assert isinstance(s.items[1], annmodel.SomeChar)
         assert isinstance(s.items[2], annmodel.SomeChar)
 
+    def test_mixin_first(self):
+        class Mixin(object):
+            _mixin_ = True
+            def foo(self): return 4
+        class Base(object):
+            def foo(self): return 5
+        class Concrete(Mixin, Base):
+            pass
+        def f():
+            return Concrete().foo()
+
+        assert f() == 4
+        a = self.RPythonAnnotator()
+        s = a.build_types(f, [])
+        assert s.const == 4
+
+    def test_mixin_last(self):
+        class Mixin(object):
+            _mixin_ = True
+            def foo(self): return 4
+        class Base(object):
+            def foo(self): return 5
+        class Concrete(Base, Mixin):
+            pass
+        def f():
+            return Concrete().foo()
+
+        assert f() == 5
+        a = self.RPythonAnnotator()
+        s = a.build_types(f, [])
+        assert s.const == 5
+
     def test_multiple_mixins_mro(self):
         # an obscure situation, but it occurred in module/micronumpy/types.py
         class A(object):


More information about the pypy-commit mailing list