@pytest.mark.skipif('not HAS_BEAUTIFUL_SOUP')
def test_backend_parsers():
 for parser in ('lxml', 'xml', 'html.parser', 'html5lib'):
  try:
   table = Table.read('t/html2.html', format='ascii.html', htmldict={'parser': parser}, guess=False)
  except FeatureNotFound:
   if (parser == 'html.parser'):
    raise
 with pytest.raises(FeatureNotFound):
  Table.read('t/html2.html', format='ascii.html', htmldict={'parser': 'foo'}, guess=False)

@ pytest . mark . skipif ( 'not HAS_BEAUTIFUL_SOUP' ) def test_backend_parsers ( ) : for parser in ( 'lxml' , 'xml' , 'html.parser' , 'html5lib' ) : try : table = Table . read ( 't/html2.html' , format = 'ascii.html' , htmldict = { 'parser' : parser } , guess = False ) except FeatureNotFound : if ( parser == 'html.parser' ) : raise with pytest . raises ( FeatureNotFound ) : Table . read ( 't/html2.html' , format = 'ascii.html' , htmldict = { 'parser' : 'foo' } , guess = False )
make sure the user can specify which back-end parser to use and that an error is raised if the parser is invalid .