Skip to content

Commit

Permalink
Fix test in narrow Py2 unicode builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder committed Jan 4, 2024
1 parent be24db7 commit c1e9e6f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lxml/tests/test_unicode.py
Expand Up @@ -46,14 +46,20 @@ def test_wide_unicode_xml(self):
def test_emoji_xml(self):
p = etree.XML(u'<p>πŸ˜„</p>')
self.assertEqual(u'πŸ˜„', p.text)
self.assertEqual(1, len(p.text))
if sys.version_info < (3,):
self.assertIn(len(p.text), [1, 2])
else:
self.assertEqual(1, len(p.text))

def test_emoji_html(self):
html = etree.HTML(u'<html><body><p>πŸ˜„</p></body></html>')
p = html[0][0]
self.assertEqual('p', p.tag)
self.assertEqual(u'πŸ˜„', p.text)
self.assertEqual(1, len(p.text))
if sys.version_info < (3,):
self.assertIn(len(p.text), [1, 2])
else:
self.assertEqual(1, len(p.text))

def test_unicode_xml_broken(self):
uxml = ('<?xml version="1.0" encoding="UTF-8"?>' +
Expand Down

0 comments on commit c1e9e6f

Please sign in to comment.