From 92cd57bffa4727ce5120aea095b54de6db8d02ea Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 17 Jul 2010 13:11:04 +0200 Subject: [PATCH] test fix for Py<=2.5 --- tests/run/cdef_members_T517.pyx | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/run/cdef_members_T517.pyx b/tests/run/cdef_members_T517.pyx index 22996817..82699de4 100644 --- a/tests/run/cdef_members_T517.pyx +++ b/tests/run/cdef_members_T517.pyx @@ -28,15 +28,14 @@ __doc__ = u""" >>> b = B() >>> b.a0 #doctest: +ELLIPSIS Traceback (most recent call last): - ... AttributeError: ... + >>> b.b0 #doctest: +ELLIPSIS Traceback (most recent call last): - ... AttributeError: ... + >>> b.c0 #doctest: +ELLIPSIS Traceback (most recent call last): - ... AttributeError: ... >>> isinstance(b.a1, type(None)) @@ -56,28 +55,35 @@ True >>> b.a1 is not b.a2 True +TYPE_FIXES_REQUIRED: + >>> b.b1 = 1 #doctest: +ELLIPSIS Traceback (most recent call last): - ... TypeError: ... + >>> b.c1 = 1 #doctest: +ELLIPSIS Traceback (most recent call last): - ... TypeError: ... + >>> b.a2 = None #doctest: +ELLIPSIS Traceback (most recent call last): - ... AttributeError: ... + >>> b.b2 = [] #doctest: +ELLIPSIS Traceback (most recent call last): - ... AttributeError: ... + >>> b.c2 = A() #doctest: +ELLIPSIS Traceback (most recent call last): - ... AttributeError: ... """ +import sys +if sys.version_info < (2,5): + __doc__ = (__doc__.split('TYPE_FIXES_REQUIRED')[0] + + __doc__.split('TYPE_FIXES_REQUIRED')[1].replace('\nAttributeError: ...', '\nTypeError: ...')) + + cdef class A: cdef public short h -- 2.26.2