A bold statement.
" with warnings.catch_warnings(record=True) as w: soup = self.soup(markup, parse_only=strainer) self.assertEqual( soup.decode(), self.document_for(markup)) self.assertTrue( "the html5lib tree builder doesn't support parse_only" in str(w[0].message)) def test_correctly_nested_tables(self): """html5lib inserts tags where other parsers don't.""" markup = ('' '' "') self.assertSoupEquals( markup, 'Here's another table:"
''
''
'
|
Here\'s another table:'
'
|
| Foo |
| Bar |
| Baz |
foo
''' soup = self.soup(markup) # Verify that we can reach thetag; this means the tree is connected. self.assertEqual(b"
foo
", soup.p.encode()) def test_reparented_markup(self): markup = 'foo
\n' soup = self.soup(markup) self.assertEqual("foo
\n", soup.body.decode()) self.assertEqual(2, len(soup.find_all('p'))) def test_reparented_markup_ends_with_whitespace(self): markup = 'foo
\n\n' soup = self.soup(markup) self.assertEqual("foo
\n\n", soup.body.decode()) self.assertEqual(2, len(soup.find_all('p'))) def test_processing_instruction(self): """Processing instructions become comments.""" markup = b"""""" soup = self.soup(markup) assert str(soup).startswith("") def test_cloned_multivalue_node(self): markup = b"""""" soup = self.soup(markup) a1, a2 = soup.find_all('a') self.assertEqual(a1, a2) assert a1 is not a2