diff options
Diffstat (limited to 'tests/run/cdef_multiple_inheritance_errors.srctree')
-rw-r--r-- | tests/run/cdef_multiple_inheritance_errors.srctree | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/run/cdef_multiple_inheritance_errors.srctree b/tests/run/cdef_multiple_inheritance_errors.srctree index e6b3426ba..4f49184f4 100644 --- a/tests/run/cdef_multiple_inheritance_errors.srctree +++ b/tests/run/cdef_multiple_inheritance_errors.srctree @@ -48,6 +48,7 @@ cdef class X(Base, Py): pass ######## oldstyle.pyx ######## +# cython: language_level=2 cdef class Base: cdef dict __dict__ @@ -64,31 +65,31 @@ import sys try: import notheaptype - assert False + assert False, "notheaptype" except TypeError as msg: assert str(msg) == "base class 'object' is not a heap type" try: import wrongbase - assert False + assert False, "wrongbase" except TypeError as msg: assert str(msg) == "best base 'str' must be equal to first base 'wrongbase.Base'" try: import badmro - assert False + assert False, "badmro" except TypeError as msg: assert str(msg).startswith("Cannot create a consistent method resolution") try: import nodict - assert False + assert False, "nodict" except TypeError as msg: assert str(msg) == "extension type 'nodict.X' has no __dict__ slot, but base type 'Py' has: either add 'cdef dict __dict__' to the extension type or add '__slots__ = [...]' to the base type" try: # This should work on Python 3 but fail on Python 2 import oldstyle - assert sys.version_info[0] >= 3 + assert sys.version_info[0] >= 3, "oldstyle" except TypeError as msg: assert str(msg) == "base class 'OldStyle' is an old-style class" |