From 9c69f6233f7944519706de5c8f9d23d2184e0221 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 14 Jun 2010 11:28:10 -0400 Subject: [PATCH] Also override hooke.util.encoding.get_encoding in test/unicode_output.py --- test/unicode_output.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/unicode_output.py b/test/unicode_output.py index 0e37e97..39ed7b0 100644 --- a/test/unicode_output.py +++ b/test/unicode_output.py @@ -32,8 +32,11 @@ Command: flat_filter_playlist... 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 - @@ -43,6 +46,6 @@ sys.setdefaultencoding('utf-8') # 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. -- 2.26.2