2011-07-28 17:38:58 |
Jonathan Lange |
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> |
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"), verbose=True)
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> |
|