From 62be0f9a7fd8bb2363092a82fc255abac32586fa Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 26 Apr 2010 07:17:52 +0200 Subject: [PATCH] Py3 test fix --- tests/run/bytes_indexing.pyx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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] -- 2.26.2