Commit 3a384e92 authored by Stefan Behnel's avatar Stefan Behnel

adapt doctests to recent buffer exception changes in Py3.5

--HG--
extra : transplant_source : %D31l%C2%F1BM%00%92l1%99%C0l%E8e%FC%9C%0C%AA
parent 19f1477f
......@@ -190,13 +190,13 @@ def acquire_nonbuffer1(first, second=None):
"""
>>> acquire_nonbuffer1(3) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: 'int' does not ... the buffer interface
TypeError:... 'int'...
>>> acquire_nonbuffer1(type) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: 'type' does not ... the buffer interface
TypeError:... 'type'...
>>> acquire_nonbuffer1(None, 2) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: 'int' does not ... the buffer interface
TypeError:... 'int'...
"""
cdef object[int] buf
buf = first
......
......@@ -14,7 +14,6 @@ from cython.parallel cimport prange, parallel
import gc
import sys
import re
if sys.version_info[0] < 3:
import __builtin__ as builtins
......@@ -26,9 +25,6 @@ __test__ = {}
def testcase(func):
doctest = func.__doc__
if sys.version_info >= (3,1,1):
doctest = doctest.replace('does not have the buffer interface',
'does not support the buffer interface')
if sys.version_info >= (3, 0):
_u = str
else:
......@@ -162,22 +158,22 @@ def acquire_failure3():
@testcase
def acquire_nonbuffer1(first, second=None):
"""
>>> acquire_nonbuffer1(3)
>>> acquire_nonbuffer1(3) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
TypeError: 'int' does not have the buffer interface
>>> acquire_nonbuffer1(type)
TypeError:... 'int'...
>>> acquire_nonbuffer1(type) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
TypeError: 'type' does not have the buffer interface
>>> acquire_nonbuffer1(None, 2)
TypeError:... 'type'...
>>> acquire_nonbuffer1(None, 2) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
TypeError: 'int' does not have the buffer interface
>>> acquire_nonbuffer1(4, object())
TypeError:... 'int'...
>>> acquire_nonbuffer1(4, object()) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
TypeError: 'int' does not have the buffer interface
TypeError:... 'int'...
"""
cdef int[:] buf
buf = first
......
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