<s> """<STR_LIT>""" <EOL> import re <EOL> import warnings <EOL> try : <EOL> import lxml . etree <EOL> LXML_PRESENT = True <EOL> LXML_VERSION = lxml . etree . LXML_VERSION <EOL> except ImportError , e : <EOL> LXML_PRESENT = False <EOL> LXML_VERSION = ( <NUM_LIT:0> , ) <EOL> if LXML_PRESENT : <EOL> from bs4 . builder import LXMLTreeBuilder , LXMLTreeBuilderForXML <EOL> from bs4 import ( <EOL> BeautifulSoup , <EOL> BeautifulStoneSoup , <EOL> ) <EOL> from bs4 . element import Comment , Doctype , SoupStrainer <EOL> from bs4 . testing import skipIf <EOL> from bs4 . tests import test_htmlparser <EOL> from bs4 . testing import ( <EOL> HTMLTreeBuilderSmokeTest , <EOL> XMLTreeBuilderSmokeTest , <EOL> SoupTest , <EOL> skipIf , <EOL> ) <EOL> @ skipIf ( <EOL> not LXML_PRESENT , <EOL> "<STR_LIT>" ) <EOL> class LXMLTreeBuilderSmokeTest ( SoupTest , HTMLTreeBuilderSmokeTest ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def default_builder ( self ) : <EOL> return LXMLTreeBuilder ( ) <EOL> def test_out_of_range_entity ( self ) : <EOL> self . assertSoupEquals ( <EOL> "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . assertSoupEquals ( <EOL> "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . assertSoupEquals ( <EOL> "<STR_LIT>" , "<STR_LIT>" ) <EOL> @ skipIf ( <EOL> not LXML_PRESENT or LXML_VERSION < ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:5> , <NUM_LIT:0> ) , <EOL> "<STR_LIT>" ) <EOL> def test_empty_doctype ( self ) : <EOL> soup = self . soup ( "<STR_LIT>" ) <EOL> doctype = soup . contents [ <NUM_LIT:0> ] <EOL> self . assertEqual ( "<STR_LIT>" , doctype . strip ( ) ) <EOL> def test_beautifulstonesoup_is_xml_parser ( self ) : <EOL> with warnings . catch_warnings ( record = True ) as w : <EOL> soup = BeautifulStoneSoup ( "<STR_LIT>" ) <EOL> self . assertEqual ( u"<STR_LIT>" , unicode ( soup . b ) ) <EOL> self . assertTrue ( "<STR_LIT>" in str ( w [ <NUM_LIT:0> ] . message ) ) <EOL> def test_real_xhtml_document ( self ) : <EOL> """<STR_LIT>""" <EOL> markup = b"""<STR_LIT>""" <EOL> soup = self . soup ( markup ) <EOL> self . assertEqual ( <EOL> soup . encode ( "<STR_LIT:utf-8>" ) . replace ( b"<STR_LIT:\n>" , b'<STR_LIT>' ) , <EOL> markup . replace ( b'<STR_LIT:\n>' , b'<STR_LIT>' ) . replace ( <EOL> b'<STR_LIT>' , b'<STR_LIT>' ) ) <EOL> @ skipIf ( <EOL> not LXML_PRESENT , <EOL> "<STR_LIT>" ) <EOL> class LXMLXMLTreeBuilderSmokeTest ( SoupTest , XMLTreeBuilderSmokeTest ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def default_builder ( self ) : <EOL> return LXMLTreeBuilderForXML ( ) </s>
