Commit 768b167d authored by Stefan Behnel's avatar Stefan Behnel

Fix test after removing the 'u' prefix from unicode string annotation values.

parent af1300f7
......@@ -7,25 +7,22 @@ print(end='') # test that language_level 3 applies immediately at the module st
cimport cython
__doc__ = """
>>> items = sorted(locals_function(1).items())
>>> for item in items:
... print('%s = %r' % item)
a = 1
b = 2
x = u'abc'
>>> except_as_deletes
True
>>> no_match_does_not_touch_target
True
"""
import sys
IS_PY2 = sys.version_info[0] < 3
if not IS_PY2:
__doc__ = __doc__.replace(" u'", " '")
def locals_function(a, b=2):
"""
>>> items = sorted(locals_function(1).items())
>>> for item in items:
... print('%s = %r' % item)
a = 1
b = 2
x = 'abc'
"""
x = 'abc'
return locals()
......@@ -352,7 +349,7 @@ def unicode_literals():
def non_ascii_unprefixed_str():
u"""
"""
>>> s = non_ascii_unprefixed_str()
>>> isinstance(s, bytes)
False
......@@ -365,7 +362,7 @@ def non_ascii_unprefixed_str():
def non_ascii_raw_str():
u"""
"""
>>> s = non_ascii_raw_str()
>>> isinstance(s, bytes)
False
......@@ -378,7 +375,7 @@ def non_ascii_raw_str():
def non_ascii_raw_prefixed_unicode():
u"""
"""
>>> s = non_ascii_raw_prefixed_unicode()
>>> isinstance(s, bytes)
False
......@@ -616,15 +613,15 @@ def annotation_syntax(a: "test new test", b : "other" = 2, *args: "ARGS", **kwar
>>> len(annotation_syntax.__annotations__)
5
>>> print(annotation_syntax.__annotations__['a'])
u'test new test'
'test new test'
>>> print(annotation_syntax.__annotations__['b'])
u'other'
'other'
>>> print(annotation_syntax.__annotations__['args'])
u'ARGS'
'ARGS'
>>> print(annotation_syntax.__annotations__['kwargs'])
u'KWARGS'
'KWARGS'
>>> print(annotation_syntax.__annotations__['return'])
u'ret'
'ret'
"""
result : int = a + b
......@@ -648,10 +645,10 @@ async def async_def_annotations(x: 'int') -> 'float':
>>> ret, arg = sorted(async_def_annotations.__annotations__.items())
>>> print(ret[0]); print(ret[1])
return
u'float'
'float'
>>> print(arg[0]); print(arg[1])
x
u'int'
'int'
"""
return float(x)
......
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