From: Stefan Behnel Date: Fri, 22 Aug 2008 19:09:02 +0000 (+0200) Subject: more test fixes X-Git-Tag: 0.9.9.2.beta~63^2~47 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2da931cd922bb1e818ef6d71bd1f37c8f9b65847;p=cython.git more test fixes --- diff --git a/tests/run/extstarargs.pyx b/tests/run/extstarargs.pyx index 20708bd5..f1d29eb2 100644 --- a/tests/run/extstarargs.pyx +++ b/tests/run/extstarargs.pyx @@ -35,9 +35,9 @@ __doc__ = u""" TypeError: swallow() takes exactly 3 positional arguments (4 given) >>> swallow(1,2,3, a=1, b=2) (1, 2, 3, (('a', 1), ('b', 2))) - >>> swallow(1,2,3, x=1) #doctest: +ELLIPSIS + >>> swallow(1,2,3, x=1) Traceback (most recent call last): - TypeError: keyword parameter 'x' was given by position and by name + TypeError: swallow() got multiple values for keyword argument 'x' >>> creosote(1,2,3) (1, 2, 3, (), ()) @@ -47,9 +47,9 @@ __doc__ = u""" (1, 2, 3, (), (('a', 1),)) >>> creosote(1,2,3,4, a=1, b=2) (1, 2, 3, (4,), (('a', 1), ('b', 2))) - >>> creosote(1,2,3,4, x=1) #doctest: +ELLIPSIS + >>> creosote(1,2,3,4, x=1) Traceback (most recent call last): - TypeError: keyword parameter 'x' was given by position and by name + TypeError: creosote() got multiple values for keyword argument 'x' >>> onlyt(1) (1,) diff --git a/tests/run/r_pythonapi.pyx b/tests/run/r_pythonapi.pyx index 9fda34a6..ead4ff33 100644 --- a/tests/run/r_pythonapi.pyx +++ b/tests/run/r_pythonapi.pyx @@ -11,7 +11,7 @@ if sys.version_info[0] >= 3: cdef extern from "string.h": void memcpy(char *d, char *s, int n) -from python cimport PyUnicode_DecodeUTF8 +from python_unicode cimport PyUnicode_DecodeUTF8 def spam(): cdef char buf[12] diff --git a/tests/run/r_toofewargs.pyx b/tests/run/r_toofewargs.pyx index 620f0ab5..0fad018a 100644 --- a/tests/run/r_toofewargs.pyx +++ b/tests/run/r_toofewargs.pyx @@ -1,13 +1,9 @@ __doc__ = u""" - >>> s = Spam() #doctest: +ELLIPSIS + >>> s = Spam() Traceback (most recent call last): - TypeError: function takes exactly 3 arguments (0 given) + TypeError: __init__() takes exactly 3 positional arguments (0 given) """ -import sys, re -if sys.version_info >= (2,6): - __doc__ = re.sub(u"Error: .*", u"Error: ...", __doc__) - cdef class Spam: def __init__(self, a, b, int c): diff --git a/tests/run/starargs.pyx b/tests/run/starargs.pyx index b6910eea..f8d810fa 100644 --- a/tests/run/starargs.pyx +++ b/tests/run/starargs.pyx @@ -31,9 +31,9 @@ __doc__ = u""" TypeError: swallow() takes exactly 3 positional arguments (4 given) >>> swallow(1,2,3, a=1, b=2) (1, 2, 3, (('a', 1), ('b', 2))) - >>> swallow(1,2,3, x=1) #doctest: +ELLIPSIS + >>> swallow(1,2,3, x=1) Traceback (most recent call last): - TypeError: keyword parameter 'x' was given by position and by name + TypeError: swallow() got multiple values for keyword argument 'x' >>> creosote(1,2,3) (1, 2, 3, (), ()) @@ -43,9 +43,9 @@ __doc__ = u""" (1, 2, 3, (), (('a', 1),)) >>> creosote(1,2,3,4, a=1, b=2) (1, 2, 3, (4,), (('a', 1), ('b', 2))) - >>> creosote(1,2,3,4, x=1) #doctest: +ELLIPSIS + >>> creosote(1,2,3,4, x=1) Traceback (most recent call last): - TypeError: keyword parameter 'x' was given by position and by name + TypeError: creosote() got multiple values for keyword argument 'x' >>> onlyt(1) (1,) @@ -84,10 +84,6 @@ __doc__ = u""" (1, ('a', 1), ('b', 2)) """ -import sys, re -if sys.version_info >= (2,6): - __doc__ = re.sub(u"(ELLIPSIS[^>]*Error: )[^\n]*\n", u"\\1...\n", __doc__, re.M) - cdef sorteditems(d): l = list(d.items()) l.sort()