← Back to team overview

testtools-dev team mailing list archive

[Merge] lp:~gz/testtools/avoid_exception_unicode_method_bug_689858 into lp:testtools

 

Martin [gz] has proposed merging lp:~gz/testtools/avoid_exception_unicode_method_bug_689858 into lp:testtools.

Requested reviews:
  testtools developers (testtools-dev)
Related bugs:
  #689858 test failures on windows w/python 2.6
  https://bugs.launchpad.net/bugs/689858


This resolves a failure jam was having on Python 2.6.4 that I couldn't reproduce on Python 2.6.6 or 2.7 - it seems there was a broken __unicode__ method added to the Exception class which has since been removed again. As the test is just trying to make sure that the exception serialisation doesn't propagate stringification errors, overriding __unicode__ to raise as well should be enough.
-- 
https://code.launchpad.net/~gz/testtools/avoid_exception_unicode_method_bug_689858/+merge/43967
Your team testtools developers is requested to review the proposed merge of lp:~gz/testtools/avoid_exception_unicode_method_bug_689858 into lp:testtools.
=== modified file 'testtools/tests/test_testresult.py'
--- testtools/tests/test_testresult.py	2010-12-04 21:04:26 +0000
+++ testtools/tests/test_testresult.py	2010-12-16 20:23:52 +0000
@@ -1230,6 +1230,8 @@
             "class UnprintableError(Exception):\n"
             "    def __str__(self):\n"
             "        raise RuntimeError\n"
+            "    def __unicode__(self):\n"
+            "        raise RuntimeError\n"
             "    def __repr__(self):\n"
             "        raise RuntimeError\n")
         textoutput = self._test_external_case(


Follow ups