fix xmlcharrefreplace tests on wide build when tests are loaded from .py[co] files.

This commit is contained in:
Benjamin Peterson 2013-10-31 20:22:41 -04:00
parent 1ef959ac3d
commit 9fa6a8ba63
3 changed files with 10 additions and 4 deletions

View File

@ -84,9 +84,9 @@ class CodecCallbackTest(unittest.TestCase):
tests = [(u'\U0001f49d', '💝'), tests = [(u'\U0001f49d', '💝'),
(u'\ud83d', '�'), (u'\ud83d', '�'),
(u'\udc9d', '�'), (u'\udc9d', '�'),
(u'\ud83d\udc9d', '💝' if len(u'\U0001f49d') > 1 else
'��'),
] ]
if u'\ud83d\udc9d' != u'\U0001f49d':
tests += [(u'\ud83d\udc9d', '��')]
for encoding in ['ascii', 'latin1', 'iso-8859-15']: for encoding in ['ascii', 'latin1', 'iso-8859-15']:
for s, exp in tests: for s, exp in tests:
self.assertEqual(s.encode(encoding, 'xmlcharrefreplace'), self.assertEqual(s.encode(encoding, 'xmlcharrefreplace'),

View File

@ -1663,9 +1663,9 @@ class UnicodeTest(
tests = [(u'\U0001f49d', '💝'), tests = [(u'\U0001f49d', '💝'),
(u'\ud83d', '�'), (u'\ud83d', '�'),
(u'\udc9d', '�'), (u'\udc9d', '�'),
(u'\ud83d\udc9d', '💝' if len(u'\U0001f49d') > 1 else
'��'),
] ]
if u'\ud83d\udc9d' != u'\U0001f49d':
tests += [(u'\ud83d\udc9d', '��')]
for s, exp in tests: for s, exp in tests:
self.assertEqual( self.assertEqual(
unicode_encodedecimal(u"123" + s, "xmlcharrefreplace"), unicode_encodedecimal(u"123" + s, "xmlcharrefreplace"),

View File

@ -16,6 +16,12 @@ IDLE
- Issue #19426: Fixed the opening of Python source file with specified encoding. - 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? What's New in Python 2.7.6 release candidate 1?
=============================================== ===============================================