diff options
Diffstat (limited to 'import-layers/yocto-poky/bitbake/lib/bs4/tests/test_lxml.py')
-rw-r--r-- | import-layers/yocto-poky/bitbake/lib/bs4/tests/test_lxml.py | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_lxml.py b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_lxml.py index 2b2e9b7e7..6c2a1d73e 100644 --- a/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_lxml.py +++ b/import-layers/yocto-poky/bitbake/lib/bs4/tests/test_lxml.py @@ -7,7 +7,7 @@ try: import lxml.etree LXML_PRESENT = True LXML_VERSION = lxml.etree.LXML_VERSION -except ImportError, e: +except ImportError as e: LXML_PRESENT = False LXML_VERSION = (0,) @@ -62,24 +62,9 @@ class LXMLTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest): # if one is installed. with warnings.catch_warnings(record=True) as w: soup = BeautifulStoneSoup("<b />") - self.assertEqual(u"<b/>", unicode(soup.b)) + self.assertEqual("<b/>", str(soup.b)) self.assertTrue("BeautifulStoneSoup class is deprecated" in str(w[0].message)) - def test_real_xhtml_document(self): - """lxml strips the XML definition from an XHTML doc, which is fine.""" - markup = b"""<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head><title>Hello.</title></head> -<body>Goodbye.</body> -</html>""" - soup = self.soup(markup) - self.assertEqual( - soup.encode("utf-8").replace(b"\n", b''), - markup.replace(b'\n', b'').replace( - b'<?xml version="1.0" encoding="utf-8"?>', b'')) - - @skipIf( not LXML_PRESENT, "lxml seems not to be present, not testing its XML tree builder.") |