Commit 2da931cd authored by Stefan Behnel's avatar Stefan Behnel

more test fixes

parent 9f1e12bf
...@@ -35,9 +35,9 @@ __doc__ = u""" ...@@ -35,9 +35,9 @@ __doc__ = u"""
TypeError: swallow() takes exactly 3 positional arguments (4 given) TypeError: swallow() takes exactly 3 positional arguments (4 given)
>>> swallow(1,2,3, a=1, b=2) >>> swallow(1,2,3, a=1, b=2)
(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): 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) >>> creosote(1,2,3)
(1, 2, 3, (), ()) (1, 2, 3, (), ())
...@@ -47,9 +47,9 @@ __doc__ = u""" ...@@ -47,9 +47,9 @@ __doc__ = u"""
(1, 2, 3, (), (('a', 1),)) (1, 2, 3, (), (('a', 1),))
>>> creosote(1,2,3,4, a=1, b=2) >>> creosote(1,2,3,4, a=1, b=2)
(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): 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) >>> onlyt(1)
(1,) (1,)
......
...@@ -11,7 +11,7 @@ if sys.version_info[0] >= 3: ...@@ -11,7 +11,7 @@ if sys.version_info[0] >= 3:
cdef extern from "string.h": cdef extern from "string.h":
void memcpy(char *d, char *s, int n) void memcpy(char *d, char *s, int n)
from python cimport PyUnicode_DecodeUTF8 from python_unicode cimport PyUnicode_DecodeUTF8
def spam(): def spam():
cdef char buf[12] cdef char buf[12]
......
__doc__ = u""" __doc__ = u"""
>>> s = Spam() #doctest: +ELLIPSIS >>> s = Spam()
Traceback (most recent call last): 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: cdef class Spam:
def __init__(self, a, b, int c): def __init__(self, a, b, int c):
......
...@@ -31,9 +31,9 @@ __doc__ = u""" ...@@ -31,9 +31,9 @@ __doc__ = u"""
TypeError: swallow() takes exactly 3 positional arguments (4 given) TypeError: swallow() takes exactly 3 positional arguments (4 given)
>>> swallow(1,2,3, a=1, b=2) >>> swallow(1,2,3, a=1, b=2)
(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): 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) >>> creosote(1,2,3)
(1, 2, 3, (), ()) (1, 2, 3, (), ())
...@@ -43,9 +43,9 @@ __doc__ = u""" ...@@ -43,9 +43,9 @@ __doc__ = u"""
(1, 2, 3, (), (('a', 1),)) (1, 2, 3, (), (('a', 1),))
>>> creosote(1,2,3,4, a=1, b=2) >>> creosote(1,2,3,4, a=1, b=2)
(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): 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) >>> onlyt(1)
(1,) (1,)
...@@ -84,10 +84,6 @@ __doc__ = u""" ...@@ -84,10 +84,6 @@ __doc__ = u"""
(1, ('a', 1), ('b', 2)) (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): cdef sorteditems(d):
l = list(d.items()) l = list(d.items())
l.sort() l.sort()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment