Created
October 29, 2012 20:42
-
-
Save asvetlov/3976411 to your computer and use it in GitHub Desktop.
Hack to print Russian letters in unittests
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
# -*- encoding: utf-8 -*- | |
import unittest | |
class TestSomething(unittest.TestCase): | |
def test_unicode(self): | |
self.assertEqual(u'Русский', u'Текст') | |
if __name__ == '__main__': | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf8') | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment