Commit 7db195ac authored by Stefan Behnel's avatar Stefan Behnel

Py3 test fixes

parent ad56990c
...@@ -12,7 +12,7 @@ True ...@@ -12,7 +12,7 @@ True
True True
True True
an integer is required an integer is required
Expected tuple, got int Expected type, got int
""" """
def import1(): def import1():
...@@ -48,13 +48,14 @@ def import4(): ...@@ -48,13 +48,14 @@ def import4():
def typed_imports(): def typed_imports():
import sys import sys
import types
cdef long maxunicode cdef long maxunicode
cdef tuple t cdef type t
from sys import maxunicode from sys import maxunicode
print maxunicode == sys.maxunicode print maxunicode == sys.maxunicode
from sys import version_info as t from types import ModuleType as t
print t is sys.version_info print t is types.ModuleType
try: try:
from sys import version_info as maxunicode from sys import version_info as maxunicode
......
...@@ -48,6 +48,10 @@ TypeError: 'int' object is unsubscriptable ...@@ -48,6 +48,10 @@ TypeError: 'int' object is unsubscriptable
>>> test_long_long() >>> test_long_long()
""" """
import sys
if sys.version_info[0] >= 3:
__doc__ = __doc__.replace(u'is unsubscriptable', u'is not subscriptable')
def index_tuple(tuple t, int i): def index_tuple(tuple t, int i):
return t[i] return t[i]
......
""" __doc__ = u"""
>>> f() >>> f()
42.0 42.0
42.0 42.0
...@@ -12,9 +12,13 @@ TypeError: readonly attribute ...@@ -12,9 +12,13 @@ TypeError: readonly attribute
Traceback (most recent call last): Traceback (most recent call last):
... ...
SystemError: bad memberdescr type SystemError: bad memberdescr type
""" """
import sys
if sys.version_info[0] >= 3:
__doc__ = __doc__.replace(u'TypeError:', u'AttributeError:')
cdef extern from "external_defs.h": cdef extern from "external_defs.h":
ctypedef float DoubleTypedef ctypedef float DoubleTypedef
ctypedef float LongDoubleTypedef ctypedef float LongDoubleTypedef
......
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