<s> """<STR_LIT>""" <EOL> import warnings <EOL> try : <EOL> from bs4 . builder import HTML5TreeBuilder <EOL> HTML5LIB_PRESENT = True <EOL> except ImportError as e : <EOL> HTML5LIB_PRESENT = False <EOL> from bs4 . element import SoupStrainer <EOL> from bs4 . testing import ( <EOL> HTML5TreeBuilderSmokeTest , <EOL> SoupTest , <EOL> skipIf , <EOL> ) <EOL> @ skipIf ( <EOL> not HTML5LIB_PRESENT , <EOL> "<STR_LIT>" ) <EOL> class HTML5LibBuilderSmokeTest ( SoupTest , HTML5TreeBuilderSmokeTest ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def default_builder ( self ) : <EOL> return HTML5TreeBuilder ( ) <EOL> def test_soupstrainer ( self ) : <EOL> strainer = SoupStrainer ( "<STR_LIT:b>" ) <EOL> markup = "<STR_LIT>" <EOL> with warnings . catch_warnings ( record = True ) as w : <EOL> soup = self . soup ( markup , parse_only = strainer ) <EOL> self . assertEqual ( <EOL> soup . decode ( ) , self . document_for ( markup ) ) <EOL> self . assertTrue ( <EOL> "<STR_LIT>" in <EOL> str ( w [ <NUM_LIT:0> ] . message ) ) <EOL> def test_correctly_nested_tables ( self ) : <EOL> """<STR_LIT>""" <EOL> markup = ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> "<STR_LIT>" <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . assertSoupEquals ( <EOL> markup , <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . assertSoupEquals ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) </s>
