summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_multibytecodec_support.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_multibytecodec_support.py')
-rw-r--r--Lib/test/test_multibytecodec_support.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_multibytecodec_support.py b/Lib/test/test_multibytecodec_support.py
index 197f777..57a4751 100644
--- a/Lib/test/test_multibytecodec_support.py
+++ b/Lib/test/test_multibytecodec_support.py
@@ -323,9 +323,17 @@ class TestBase_Mapping(unittest.TestCase):
def _testpoint(self, csetch, unich):
if (csetch, unich) not in self.pass_enctest:
- self.assertEqual(unich.encode(self.encoding), csetch)
+ try:
+ self.assertEqual(unich.encode(self.encoding), csetch)
+ except UnicodeError, exc:
+ self.fail('Encoding failed while testing %s -> %s: %s' % (
+ repr(unich), repr(csetch), exc.reason))
if (csetch, unich) not in self.pass_dectest:
- self.assertEqual(unicode(csetch, self.encoding), unich)
+ try:
+ self.assertEqual(csetch.decode(self.encoding), unich)
+ except UnicodeError, exc:
+ self.fail('Decoding failed while testing %s -> %s: %s' % (
+ repr(csetch), repr(unich), exc.reason))
def load_teststring(encoding):
from test import cjkencodings_test