import sys
reload(sys)
sys.setdefaultencoding('utf-8')
+import hooke.util.encoding
+hooke.util.encoding.get_encoding = lambda : 'utf-8'
-# setdefaultencoding to work around doctest/unicode limitations:
+# Override defaultencoding and get_encoding to work around
+# doctest/unicode limitations:
# Doctest: test.unicode_output
# ... /usr/lib/python2.6/doctest.py:1475: UnicodeWarning: Unicode
# equal comparison failed to convert both arguments to Unicode -
# http://stackoverflow.com/questions/1733414/how-do-i-include-unicode-strings-in-python-doctests
# for details.
#
-# Unfortunately, the setdefaultencoding also makes the
-# codecs.getwriter() code that this test is supposed to check a no-op.
-# Ah well, guess this will have to wait for Python 3.
+# Unfortunately, the override also makes the codecs.getwriter() code
+# that this test is supposed to check a no-op. Ah well, guess this
+# will have to wait for Python 3.