Skip to content

Commit

Permalink
enable tests on py2
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Nov 15, 2021
1 parent 75f4a70 commit 59114a0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/test_doc_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ def test_templated_callback(self):
def ann_f1(arg):
return 3.1415*arg
ann_f1.__annotations__ = {'arg': 'int', 'return': 'double'}
def ann_f2(arg1, arg2) -> 'int':
def ann_f2(arg1, arg2):
return 3*arg1*arg2
ann_f2.__annotations__ = {'arg1': 'int', 'arg2' : 'int', 'return': 'int'}
else:
Expand Down Expand Up @@ -1270,5 +1270,8 @@ def test_unicode(self):
return to_str(chars);
}}""")

assert CC.gbk_chinese() == '中文'.encode('gbk')
assert CC.utf8_chinese() == '中文'
assert CC.gbk_chinese() == u'\u4e2d\u6587'.encode('gbk')
if 0x3000000 <= sys.hexversion:
assert CC.utf8_chinese() == u'\u4e2d\u6587'
else:
assert CC.utf8_chinese() == b'\xe4\xb8\xad\xe6\x96\x87'

0 comments on commit 59114a0

Please sign in to comment.