nose-devs/nose — Issue #32: failuredetail:formatFailure can't accept unicode string
Author: jpellerin
Created: 2011-12-14 15:56:06+00:00
State: open

What steps will reproduce the problem?
1. Put this somewhere in your unit test method

# -*- coding: utf-8 -*-
...

def testi18n(self):
self.assertEqual(u'電郵', 'Email')

2. run nosetest

What is the expected output? What do you see instead?

Traceback (most recent call last):
File "/Users/wyuenho/Documents/workspace/hometasty/lib/python2.6/site-packages/nose/case.py", line 133, in run
self.runTest(result)
File "/Users/wyuenho/Documents/workspace/hometasty/lib/python2.6/site-packages/nose/case.py", line 151, in runTest
test(result)
File "/Users/wyuenho/Documents/workspace/hometasty/lib/python2.6/site-packages/unittest2/case.py", line 398, in __call__
return self.run(*args, **kwds)
File "/Users/wyuenho/Documents/workspace/hometasty/lib/python2.6/site-packages/unittest2/case.py", line 342, in run
result.addFailure(self, sys.exc_info())
File "/Users/wyuenho/Documents/workspace/hometasty/lib/python2.6/site-packages/nose/proxy.py", line 136, in addFailure
formatted = plugins.formatFailure(self.test, err)
File "/Users/wyuenho/Documents/workspace/hometasty/lib/python2.6/site-packages/nose/plugins/manager.py", line 94, in __call__
return self.call(*arg, **kw)
File "/Users/wyuenho/Documents/workspace/hometasty/lib/python2.6/site-packages/nose/plugins/manager.py", line 136, in chain
result = meth(*arg, **kw)
File "/Users/wyuenho/Documents/workspace/hometasty/lib/python2.6/site-packages/nose/plugins/failuredetail.py", line 43, in formatFailure
return (ec, '\n'.join([str(ev), tbinfo]), tb)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 30-31: ordinal not in range(128)

What version of the product are you using? On what operating system?
nose 1.0.0, python 2.6, Mac OS X 10.6.7

Google Code Info:
Issue #: 415
Author: wyue...@gmail.com
Created On: 2011-04-30T06:51:23.000Z
Closed On: