]> granicus.if.org Git - python/commitdiff
fix xmlcharrefreplace tests on wide build when tests are loaded from .py[co] files.
authorBenjamin Peterson <benjamin@python.org>
Fri, 1 Nov 2013 00:22:41 +0000 (20:22 -0400)
committerBenjamin Peterson <benjamin@python.org>
Fri, 1 Nov 2013 00:22:41 +0000 (20:22 -0400)
Lib/test/test_codeccallbacks.py
Lib/test/test_unicode.py
Misc/NEWS

index ecaf9970a1ddbb72b3768dd9011828aa67e5ffb2..dbdb4f4507a365389b309174161c833969ba4b20 100644 (file)
@@ -84,9 +84,9 @@ class CodecCallbackTest(unittest.TestCase):
         tests = [(u'\U0001f49d', '&#128157;'),
                  (u'\ud83d', '&#55357;'),
                  (u'\udc9d', '&#56477;'),
-                 (u'\ud83d\udc9d', '&#128157;' if len(u'\U0001f49d') > 1 else
-                                   '&#55357;&#56477;'),
                 ]
+        if u'\ud83d\udc9d' != u'\U0001f49d':
+            tests += [(u'\ud83d\udc9d', '&#55357;&#56477;')]
         for encoding in ['ascii', 'latin1', 'iso-8859-15']:
             for s, exp in tests:
                 self.assertEqual(s.encode(encoding, 'xmlcharrefreplace'),
index 666cab87255eaa9ee7cbd6a78a721feba3fc5a0a..925d25a15bd60a1b7e2e45b9fda0db982a991bb1 100644 (file)
@@ -1663,9 +1663,9 @@ class UnicodeTest(
         tests = [(u'\U0001f49d', '&#128157;'),
                  (u'\ud83d', '&#55357;'),
                  (u'\udc9d', '&#56477;'),
-                 (u'\ud83d\udc9d', '&#128157;' if len(u'\U0001f49d') > 1 else
-                                  '&#55357;&#56477;'),
                 ]
+        if u'\ud83d\udc9d' != u'\U0001f49d':
+            tests += [(u'\ud83d\udc9d', '&#55357;&#56477;')]
         for s, exp in tests:
             self.assertEqual(
                     unicode_encodedecimal(u"123" + s, "xmlcharrefreplace"),
index 79ab674af6714cde7dd66f233d211dda3b3919b2..c353571854ac5935315c4afb8c09da85f13fec03 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,12 @@ IDLE
 
 - Issue #19426: Fixed the opening of Python source file with specified encoding.
 
+Tests
+-----
+
+- Issue #19457: Fixed xmlcharrefreplace tests on wide build when tests are
+  loaded from .py[co] files.
+
 
 What's New in Python 2.7.6 release candidate 1?
 ===============================================