DocTestMatches error when 'actual' is unicode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
testtools |
Fix Released
|
Critical
|
Martin Packman |
Bug Description
When TestCase.assertThat is invoked with a unicode string and a DocTestMatches instance, the _with_nl() call made by the DocTestMatches.
class MyTestCase(
def myTest(self):
foo = u"foo\u2026"
self.
Trackback:
File "/home/
mismatch = matcher.
File "/home/
with_nl = self._with_
File "/home/
result = str(actual)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 3: ordinal not in range(128)
------------
Related branches
- Jonathan Lange: Needs Fixing
-
Diff: 87 lines (+58/-1) (has conflicts)2 files modifiedtesttools/matchers.py (+39/-1)
testtools/tests/test_matchers.py (+19/-0)
tags: | added: unicode |
Changed in testtools: | |
status: | Triaged → In Progress |
assignee: | nobody → Martin [gz] (gz) |
Changed in testtools: | |
status: | In Progress → Fix Committed |
milestone: | none → next |
Changed in testtools: | |
status: | Fix Committed → Fix Released |
Thanks. Will try to fix this soon.