summaryrefslogtreecommitdiff
path: root/testlib.py
diff options
context:
space:
mode:
authorFabrice Douchant <Fabrice.Douchant@logilab.fr>2008-10-17 15:52:13 +0200
committerFabrice Douchant <Fabrice.Douchant@logilab.fr>2008-10-17 15:52:13 +0200
commitc07e2ab2804ae24c52f790e1e4c26a37b324cc29 (patch)
tree40545eaa55a0de0e36cd87e677c191f603039e13 /testlib.py
parent07818f75e913b3f26aa719f6ef1b8b501d4b4c84 (diff)
downloadlogilab-common-c07e2ab2804ae24c52f790e1e4c26a37b324cc29.tar.gz
bugfix when trying to print into consol not supported UTF-8 caracters (seems wired so)
Diffstat (limited to 'testlib.py')
-rw-r--r--testlib.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/testlib.py b/testlib.py
index 8b95666..485e08d 100644
--- a/testlib.py
+++ b/testlib.py
@@ -409,7 +409,6 @@ class SkipAwareTestResult(unittest._TextTestResult):
def printErrorList(self, flavour, errors):
for (_, descr), (test, err) in zip(self.descrs_for(flavour), errors):
- #print 'HERRRRRE', type(self.stream)
if PYGMENTS_FOUND and isatty(self.stream):
err = highlight(err, lexers.PythonLexer(),
formatters.terminal.TerminalFormatter())
@@ -421,7 +420,7 @@ class SkipAwareTestResult(unittest._TextTestResult):
self.stream.writeln("%s: %s" % (flavour, descr))
self.stream.writeln(self.separator2)
- self.stream.writeln(str(err))
+ self.stream.writeln("%s" % err.encode(sys.stdout.encoding, 'replace'))
try:
output, errput = test.captured_output()
except AttributeError: