@pytest.mark.skipif('not HAS_BEAUTIFUL_SOUP')
def test_soupstring():
 soup = BeautifulSoup('<html><head></head><body><p>foo</p></body></html>')
 soup_str = html.SoupString(soup)
 assert isinstance(soup_str, str)
 assert isinstance(soup_str, html.SoupString)
 assert (soup_str == '<html><head></head><body><p>foo</p></body></html>')
 assert (soup_str.soup is soup)

@ pytest . mark . skipif ( 'not HAS_BEAUTIFUL_SOUP' ) def test_soupstring ( ) : soup = BeautifulSoup ( '<html><head></head><body><p>foo</p></body></html>' ) soup_str = html . SoupString ( soup ) assert isinstance ( soup_str , str ) assert isinstance ( soup_str , html . SoupString ) assert ( soup_str == '<html><head></head><body><p>foo</p></body></html>' ) assert ( soup_str . soup is soup )
test to make sure the class soupstring behaves properly .