testtools-dev team mailing list archive
-
testtools-dev team
-
Mailing list archive
-
Message #00720
[Bug 804127] [NEW] assertThat should be careful when handling unicode
Public bug reported:
The assertThat method for use with matchers creates AssertionError
instances that don't stringify on Python 2.4, 2.5, and some 2.6 minor
versions when used with a non-ascii unicode argument. The
testtools.testresults code has some robustness that means the failure is
still printed, but other runners may break if the UnicodeEncodeError
from trying to stringify the exception propagates.
Instead of the expected output, these older Pythons get:
Traceback (most recent call last):
...
self.assertThat(u"\xa7", Equals(u"a"))
File "C:\Python24\Lib\site-packages\testtools\testcase.py", line 351, in assertThat
self.fail('Match failed. Matchee: "%s"\nMatcher: %s\nDifference: %s\n'
AssertionError: <unprintable AssertionError object>
** Affects: testtools
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of testtools
developers, which is subscribed to testtools.
https://bugs.launchpad.net/bugs/804127
Title:
assertThat should be careful when handling unicode
Status in testtools:
New
Bug description:
The assertThat method for use with matchers creates AssertionError
instances that don't stringify on Python 2.4, 2.5, and some 2.6 minor
versions when used with a non-ascii unicode argument. The
testtools.testresults code has some robustness that means the failure
is still printed, but other runners may break if the
UnicodeEncodeError from trying to stringify the exception propagates.
Instead of the expected output, these older Pythons get:
Traceback (most recent call last):
...
self.assertThat(u"\xa7", Equals(u"a"))
File "C:\Python24\Lib\site-packages\testtools\testcase.py", line 351, in assertThat
self.fail('Match failed. Matchee: "%s"\nMatcher: %s\nDifference: %s\n'
AssertionError: <unprintable AssertionError object>
To manage notifications about this bug go to:
https://bugs.launchpad.net/testtools/+bug/804127/+subscriptions
Follow ups
-
[Bug 804127] Re: assertThat(..., verbose=True) sometimes generates unprintable AssertionErrors
From: Jonathan Lange, 2011-08-05
-
[Bug 804127] Re: assertThat(..., verbose=True) sometimes generates unprintable AssertionErrors
From: Launchpad Bug Tracker, 2011-08-05
-
[Bug 804127] Re: assertThat(..., verbose=True) sometimes generates unprintable AssertionErrors
From: Jonathan Lange, 2011-08-04
-
[Bug 804127] Re: assertThat(..., verbose=True) sometimes generates unprintable AssertionErrors
From: Martin [gz], 2011-08-04
-
[Bug 804127] Re: assertThat(..., verbose=True) sometimes generates unprintable AssertionErrors
From: Jonathan Lange, 2011-07-28
-
[Bug 804127] Re: assertThat sometimes generates unprintable AssertionErrors
From: Jonathan Lange, 2011-07-28
-
[Bug 804127] Re: assertThat should be careful when handling unicode
From: Jonathan Lange, 2011-07-01
-
[Bug 804127] [NEW] assertThat should be careful when handling unicode
From: Martin [gz], 2011-07-01
References