summaryrefslogtreecommitdiff
path: root/bs4/testing.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2013-05-07 08:19:02 -0400
committerLeonard Richardson <leonardr@segfault.org>2013-05-07 08:19:02 -0400
commit269157a8f40dfdac082f39befd69f170263d2ce1 (patch)
tree6de82a5e216da6dc16430a94e2ed411e920d372a /bs4/testing.py
parentc4ce22b415ab81ba0e3fb4a3fb28f4ce68dccbde (diff)
Now that lxml's segfault on invalid doctype has been fixed, fix a
corresponding problem on the Beautiful Soup end that was previously invisible. [bug=984936]
Diffstat (limited to 'bs4/testing.py')
-rw-r--r--bs4/testing.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bs4/testing.py b/bs4/testing.py
index c9307d3..ed71d3b 100644
--- a/bs4/testing.py
+++ b/bs4/testing.py
@@ -81,6 +81,11 @@ class HTMLTreeBuilderSmokeTest(object):
self.assertDoctypeHandled(
'html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"')
+ def test_empty_doctype(self):
+ soup = self.soup("<!DOCTYPE>")
+ doctype = soup.contents[0]
+ self.assertEqual("", doctype.strip())
+
def test_public_doctype_with_url(self):
doctype = 'html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"'
self.assertDoctypeHandled(doctype)