Commit d6ea7356 authored by Stefan Behnel's avatar Stefan Behnel

Work around Py2 unicode print issue in tests.

parent 1d23d182
......@@ -555,7 +555,12 @@ def annotation_syntax(a: "test new test", b : "other" = 2, *args: "ARGS", **kwar
async def async_def_annotations(x: 'int') -> 'float':
"""
>>> sorted(async_def_annotations.__annotations__.items())
[('return', 'float'), ('x', 'int')]
>>> ret, arg = sorted(async_def_annotations.__annotations__.items())
>>> print(ret[0]); print(ret[1])
return
float
>>> print(arg[0]); print(arg[1])
x
int
"""
return float(x)
......@@ -29,7 +29,12 @@ def anno_gen(x: 'int') -> 'float':
>>> gen = anno_gen(2)
>>> next(gen)
2.0
>>> sorted(anno_gen.__annotations__.items())
[('return', 'float'), ('x', 'int')]
>>> ret, arg = sorted(anno_gen.__annotations__.items())
>>> print(ret[0]); print(ret[1])
return
float
>>> print(arg[0]); print(arg[1])
x
int
"""
yield 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