summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2014-10-10 23:40:02 +0200
committerStefan Behnel <stefan_ml@behnel.de>2014-10-10 23:40:02 +0200
commit3a384e9226f44f53733306fa717967bdd4cdc199 (patch)
treef9ec69e74ccab3905469496a52eeaadada5d0e78
parent19f1477f01dfca93c1b188686302d3595cdf1151 (diff)
downloadcython-3a384e9226f44f53733306fa717967bdd4cdc199.tar.gz
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
-rw-r--r--tests/buffers/bufaccess.pyx6
-rw-r--r--tests/memoryview/memslice.pyx20
2 files changed, 11 insertions, 15 deletions
diff --git a/tests/buffers/bufaccess.pyx b/tests/buffers/bufaccess.pyx
index 077dde004..089239c1e 100644
--- a/tests/buffers/bufaccess.pyx
+++ b/tests/buffers/bufaccess.pyx
@@ -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
diff --git a/tests/memoryview/memslice.pyx b/tests/memoryview/memslice.pyx
index bd7e59c24..2ef265865 100644
--- a/tests/memoryview/memslice.pyx
+++ b/tests/memoryview/memslice.pyx
@@ -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