From: Stefan Behnel Date: Mon, 26 Apr 2010 05:17:52 +0000 (+0200) Subject: Py3 test fix X-Git-Tag: 0.13.beta0~144 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=62be0f9a7fd8bb2363092a82fc255abac32586fa;p=cython.git Py3 test fix --- diff --git a/tests/run/bytes_indexing.pyx b/tests/run/bytes_indexing.pyx index fbb9a6ef..eeba85c0 100644 --- a/tests/run/bytes_indexing.pyx +++ b/tests/run/bytes_indexing.pyx @@ -5,13 +5,16 @@ cdef bytes b12345 = b'12345' def index_literal(int i): """ - >>> index_literal(0) == '1'.encode('ASCII') + Python 3 returns integer values on indexing, Py2 returns byte + string literals... + + >>> index_literal(0) in (ord('1'), '1') True - >>> index_literal(-5) == '1'.encode('ASCII') + >>> index_literal(-5) in (ord('1'), '1') True - >>> index_literal(2) == '3'.encode('ASCII') + >>> index_literal(2) in (ord('3'), '3') True - >>> index_literal(4) == '5'.encode('ASCII') + >>> index_literal(4) in (ord('5'), '5') True """ return b"12345"[i]