Created
October 31, 2014 16:32
-
-
Save DecKen/244bc259abcbf973b1af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
def test(string): | |
u""" | |
>>> test(u"Hello") | |
u'Hello' | |
>>> test(u"你好") | |
u"你好" | |
""" | |
return string | |
if __name__ == '__main__': | |
import doctest | |
doctest.testmod() | |
错误提示: | |
********************************************************************** | |
File "C:/Projects/Python/tutorial/test.py", line 10, in __main__.test | |
Failed example: | |
test(u"你好") | |
Expected: | |
u"你好" | |
Got: | |
u'\u4f60\u597d' | |
********************************************************************** | |
1 items had failures: | |
1 of 2 in __main__.test | |
***Test Failed*** 1 failures. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment